diff options
author | 2013-04-17 18:40:58 +0000 | |
---|---|---|
committer | 2013-04-17 18:40:58 +0000 | |
commit | a2744935abfc4886a6ecd24882bbeffcee19f4eb (patch) | |
tree | f354c3fde7e3622e07913998feb425ca9a94a520 /lib/libc/stdlib/strtonum.c | |
parent | Don't set the frequency of the statclock if we don't have one. (diff) | |
download | wireguard-openbsd-a2744935abfc4886a6ecd24882bbeffcee19f4eb.tar.xz wireguard-openbsd-a2744935abfc4886a6ecd24882bbeffcee19f4eb.zip |
the tiniest of style tweaks
Diffstat (limited to 'lib/libc/stdlib/strtonum.c')
-rw-r--r-- | lib/libc/stdlib/strtonum.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/stdlib/strtonum.c b/lib/libc/stdlib/strtonum.c index e426388ed0f..1aeee3467b8 100644 --- a/lib/libc/stdlib/strtonum.c +++ b/lib/libc/stdlib/strtonum.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* * Copyright (c) 2004 Ted Unangst and Todd Miller @@ -21,17 +21,17 @@ #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; @@ -44,9 +44,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 (numstr == ep || *ep != '\0') error = INVALID; |