Skip to content

Commit

Permalink
filebundle: another fb_read thinko fix
Browse files Browse the repository at this point in the history
  • Loading branch information
perexg committed Mar 8, 2016
1 parent d82a025 commit 60040a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/filebundle.c
Expand Up @@ -536,7 +536,7 @@ ssize_t fb_read ( fb_file *fp, void *buf, size_t count )
char *fb_gets ( fb_file *fp, void *buf, size_t count )
{
ssize_t c = 0, err;
while ((err = fb_read(fp, buf+c, 1)) && c < (count-1)) {
while ((err = fb_read(fp, buf+c, 1)) > 0 && c < (count-1)) {
char b = ((char*)buf)[c];
c++;
if (b == '\n' || b == '\0') break;
Expand Down

0 comments on commit 60040a4

Please sign in to comment.