Date: Fri, 16 Jul 2010 17:58:36 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 181058 for review Message-ID: <201007161758.o6GHwaDO081156@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@181058?ac=10 Change 181058 by gabor@gabor_aspire on 2010/07/16 17:58:19 - Reset errno before calls that may set it up to avoid cases, where it is set by another preceding call. This is probably not necessary but makes the code safer. Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/grep.c#95 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#95 (text+ko) ==== @@ -381,6 +381,7 @@ /* FALLTHROUGH */ case 'A': case 'B': + errno = 0; l = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (l == ULLONG_MAX)) || ((errno == EINVAL) && (l == 0))) @@ -465,6 +466,7 @@ break; case 'm': mflag = true; + errno = 0; mcount = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == ULLONG_MAX)) || ((errno == EINVAL) && (mcount == 0)))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007161758.o6GHwaDO081156>