PERFORCE change 181058 for review

Gabor Kovesdan gabor at FreeBSD.org
Fri Jul 16 17:58:37 UTC 2010


http://p4web.freebsd.org/@@181058?ac=10

Change 181058 by gabor at 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)))


More information about the p4-projects mailing list