Skip to content

Commit

Permalink
Patch wak to line-buffer inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar committed May 26, 2024
1 parent c6a5e00 commit acee357
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wak.c
Original file line number Diff line number Diff line change
Expand Up @@ -3583,7 +3583,11 @@ static ssize_t getrec_f(struct zfile *zfp)
#define RS_LENGTH_MARGIN (INIT_RECBUF_LEN / 8)
if (!zfp->recbuf)
zfp->recbuf = xmalloc((zfp->recbufsize = INIT_RECBUF_LEN) + 1);
zfp->endoffs = fread(zfp->recbuf, 1, zfp->recbufsize, zfp->fp);
if (fgets(zfp->recbuf, zfp->recbufsize, zfp->fp)) {
zfp->endoffs = strlen(zfp->recbuf);
} else {
zfp->endoffs = 0;
}
zfp->recoffs = 0;
zfp->recbuf[zfp->endoffs] = 0;
if (!zfp->endoffs) break;
Expand Down

0 comments on commit acee357

Please sign in to comment.