PERFORCE change 145718 for review
Gabor Kovesdan
gabor at FreeBSD.org
Wed Jul 23 15:26:23 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=145718
Change 145718 by gabor at gabor_server on 2008/07/23 15:26:09
- Fix off-by-one bug
Affected files ...
.. //depot/projects/soc2008/gabor_textproc/grep/file.c#25 edit
Differences ...
==== //depot/projects/soc2008/gabor_textproc/grep/file.c#25 (text+ko) ====
@@ -156,8 +156,10 @@
/* Read a line whether from the buffer or from the file itself. */
for (i = 0; ; i++) {
if (binbufptr == &binbuf[binbufsiz]) {
- if (grep_feof(f))
+ if (grep_feof(f)) {
+ i--;
break;
+ }
ch = grep_fgetc(f);
} else {
ch = binbufptr[0];
More information about the p4-projects
mailing list