tHandle files smaller than 127 bytes - synk - synchronize files between hosts
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0f59adb46300524c2901a4a11c4a96f493413bbc
(DIR) parent 6dc505684ce6858d82889b8c487b768daaa3533d
(HTM) Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 12:16:23 +0200
Handle files smaller than 127 bytes
Diffstat:
M sha512.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/sha512.c b/sha512.c
t@@ -287,7 +287,7 @@ int
sha512(FILE *stream, unsigned char *hash)
{
sha512_state md;
- size_t len = 0;
+ ssize_t len = 0;
unsigned char buf[127];
if (sha512_init(&md) != 0) {
t@@ -295,7 +295,7 @@ sha512(FILE *stream, unsigned char *hash)
return 1;
}
- while ((len = fread(buf, 127, 1, stream)) > 0) {
+ while ((len = fread(buf, 1, 127, stream)) > 0) {
if (sha512_process(&md, buf, len) != 0) {
return 1;
}