diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2014-08-13 03:44:30 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2014-08-13 03:44:30 +0000 |
commit | ef01caf5cb3824c908468224920c314b4b018c51 (patch) | |
tree | 41f69bff4faf4eaf8306e3e4dc57d646a1f26daf | |
parent | 9c851217b6d0d7a2d80f1d379654cae8ce045744 (diff) | |
download | src-ef01caf5cb3824c908468224920c314b4b018c51.tar.gz src-ef01caf5cb3824c908468224920c314b4b018c51.zip |
Minor style tweaks.
Obtained from: OpenBSD (CVS rev. 1.7)
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=269901
-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 6dccd973606b..aa433d835b36 100644 --- a/lib/libc/stdlib/strtonum.c +++ b/lib/libc/stdlib/strtonum.c @@ -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 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; |