sick

sign and check files using ed25519
git clone git://z3bra.org/sick
Log | Files | Refs | Submodules | README | LICENSE

commit 64c338df3e9e8f8e4d407f4fe1d1811ece190752
parent b9f3b5b125d654314a9b5964d7728b4e7222fd63
Author: z3bra <contactatz3bradotorg>
Date:   Mon Mar 13 22:52:24 +0100

Stop bufferizing on end-of-file

Diffstat:
sick.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sick.c b/sick.c @@ -88,7 +88,7 @@ bufferize(char **buf, FILE *fp) * For each chunk read, reallocate the buffer size to fit the newly * read data, and copy it over */ - while ((n = fread(chunk, 1, _POSIX_MAX_INPUT, fp)) > 0) { + while (!feof(fp) && (n = fread(chunk, 1, _POSIX_MAX_INPUT, fp)) > 0) { if ((tmp = realloc(*buf, len + n)) == NULL) { free(*buf); *buf = NULL;