From: Jaroslav Kysela Date: Tue, 8 Mar 2016 11:33:39 +0000 (+0100) Subject: filebundle: another fb_read thinko fix X-Git-Tag: v4.0.9~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60040a42418bdee4870a03af1e6076a9c1de3950;p=thirdparty%2Ftvheadend.git filebundle: another fb_read thinko fix --- diff --git a/src/filebundle.c b/src/filebundle.c index 6d238fa5f..2b1d0ae4e 100644 --- a/src/filebundle.c +++ b/src/filebundle.c @@ -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;