From owner-p4-projects@FreeBSD.ORG Fri Jul 16 17:58:36 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AFE3F1065674; Fri, 16 Jul 2010 17:58:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741831065670 for ; Fri, 16 Jul 2010 17:58:36 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 614C48FC13 for ; Fri, 16 Jul 2010 17:58:36 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o6GHwaPw081158 for ; Fri, 16 Jul 2010 17:58:36 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o6GHwaDO081156 for perforce@freebsd.org; Fri, 16 Jul 2010 17:58:36 GMT (envelope-from gabor@freebsd.org) Date: Fri, 16 Jul 2010 17:58:36 GMT Message-Id: <201007161758.o6GHwaDO081156@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 181058 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 17:58:37 -0000 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)))