Skip to content

Commit c0b1338

Browse files
committed
Improve comments in fflush and _flushbuf
1 parent e82ec68 commit c0b1338

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapter08/8-4-linebuf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int _flushbuf(int x, FILE *fp)
139139

140140
if (fp->flag & _UNBUF)
141141
bufsize = 1;
142-
else if (fp->flag & _EOF) /* coordinate with fflush */
142+
else if (fp->flag & _EOF) /* flush written data only (fflush) */
143143
bufsize = BUFSIZ - fp->cnt;
144144
else
145145
bufsize = BUFSIZ;
@@ -196,7 +196,7 @@ int fflush(FILE *fp)
196196
for ( ; fp < cond; fp++) {
197197
if ((fp->flag & (_WRITE | _EOF | _ERR)) != _WRITE)
198198
return EOF;
199-
fp->flag |= _EOF; /* coordinate with _flushbuf */
199+
fp->flag |= _EOF; /* singal EOF to _flushbuf */
200200
if (_flushbuf(*fp->ptr, fp) < 0)
201201
return EOF;
202202
*fp->ptr = '\0';

0 commit comments

Comments
 (0)