synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit 0f59adb46300524c2901a4a11c4a96f493413bbc
parent 6dc505684ce6858d82889b8c487b768daaa3533d
Author: Willy <willyatmailoodotorg>
Date:   Tue Sep  6 12:16:23 +0200

Handle files smaller than 127 bytes

Diffstat:
sha512.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sha512.c b/sha512.c @@ -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) { @@ -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; }