Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2008 14:03:40 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 146524 for review
Message-ID:  <200808031403.m73E3ehB033443@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146524

Change 146524 by gabor@gabor_server on 2008/08/03 14:02:45

	IFC

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/src/usr.bin/grep/file.c#4 integrate

Differences ...

==== //depot/projects/soc2008/gabor_textproc/src/usr.bin/grep/file.c#4 (text+ko) ====

@@ -128,7 +128,7 @@
 	if (binbufptr == NULL) {
 		/* Only pre-read to the buffer if we need the binary check. */
 		if (binbehave != BINFILE_TEXT) {
-			for (; (i < (BUFSIZ * sizeof(wint_t))) && !grep_feof(f); i++) {
+			for (; i < sizeof(wbinbuf) && !grep_feof(f); i++) {
 				ch = grep_fgetc(f);
 				binbuf[i] = ch;
 			}
@@ -137,7 +137,7 @@
 
 			/* Convert at most (BUFSIZ * sizeof(wint_t)) characters or
 				(BUFSIZ - 1) bytes to wide character string. */
-			size = mbsnrtowcs(wbinbuf, &src, BUFSIZ * sizeof(wint_t), BUFSIZ - 1, &mbs);
+			size = mbsnrtowcs(wbinbuf, &src, sizeof(wbinbuf), BUFSIZ - 1, &mbs);
 			f->binary = 0;
 			for (; size > 0; size--)
 				if (iswbinary(wbinbuf[size])) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808031403.m73E3ehB033443>