Date: Sat, 16 Aug 2014 01:03:51 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270033 - stable/10/lib/libc/stdlib Message-ID: <201408160103.s7G13pWh014383@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Sat Aug 16 01:03:51 2014 New Revision: 270033 URL: http://svnweb.freebsd.org/changeset/base/270033 Log: MFC r269901: Minor style tweaks. Obtained from: OpenBSD (CVS rev. 1.7) Modified: stable/10/lib/libc/stdlib/strtonum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/strtonum.c ============================================================================== --- stable/10/lib/libc/stdlib/strtonum.c Sat Aug 16 01:00:37 2014 (r270032) +++ stable/10/lib/libc/stdlib/strtonum.c Sat Aug 16 01:03:51 2014 (r270033) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ + * $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ #include <sys/cdefs.h> @@ -24,17 +24,17 @@ __FBSDID("$FreeBSD$"); #include <limits.h> #include <stdlib.h> -#define INVALID 1 -#define TOOSMALL 2 -#define TOOLARGE 3 +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) { long long ll = 0; - char *ep; int error = 0; + char *ep; struct errval { const char *errstr; int err; @@ -47,9 +47,9 @@ strtonum(const char *numstr, long long m ev[0].err = errno; errno = 0; - if (minval > maxval) + if (minval > maxval) { error = INVALID; - else { + } else { ll = strtoll(numstr, &ep, 10); if (errno == EINVAL || numstr == ep || *ep != '\0') error = INVALID;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408160103.s7G13pWh014383>