From c40e45b75eb76d79a05c7fa85c1fa9b5c728a12f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 7 Oct 2016 15:10:20 +0200 Subject: Update to FreeBSD head 2016-08-23 Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd. --- freebsd/lib/libc/stdlib/strtonum.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'freebsd/lib/libc/stdlib/strtonum.c') diff --git a/freebsd/lib/libc/stdlib/strtonum.c b/freebsd/lib/libc/stdlib/strtonum.c index c55cb7d7..528380b7 100644 --- a/freebsd/lib/libc/stdlib/strtonum.c +++ b/freebsd/lib/libc/stdlib/strtonum.c @@ -16,7 +16,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 @@ -26,17 +26,17 @@ __FBSDID("$FreeBSD$"); #include #include -#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; @@ -49,9 +49,9 @@ strtonum(const char *numstr, long long minval, long long maxval, 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; -- cgit v1.2.3