diff options
author | tedu <> | 2013-04-17 18:40:58 +0000 |
---|---|---|
committer | tedu <> | 2013-04-17 18:40:58 +0000 |
commit | a061f61d9f5cb094b5c0360975cf2988548487c2 (patch) | |
tree | d918086add6e829851f6c6dba793e02d5908da9d /src | |
parent | 2931c2cee818cf240b3bf21e65038ea457610380 (diff) | |
download | openbsd-a061f61d9f5cb094b5c0360975cf2988548487c2.tar.gz openbsd-a061f61d9f5cb094b5c0360975cf2988548487c2.tar.bz2 openbsd-a061f61d9f5cb094b5c0360975cf2988548487c2.zip |
the tiniest of style tweaks
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/strtonum.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libc/stdlib/strtonum.c b/src/lib/libc/stdlib/strtonum.c index e426388ed0..1aeee3467b 100644 --- a/src/lib/libc/stdlib/strtonum.c +++ b/src/lib/libc/stdlib/strtonum.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ | 1 | /* $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2004 Ted Unangst and Todd Miller | 4 | * Copyright (c) 2004 Ted Unangst and Todd Miller |
@@ -21,17 +21,17 @@ | |||
21 | #include <limits.h> | 21 | #include <limits.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | 23 | ||
24 | #define INVALID 1 | 24 | #define INVALID 1 |
25 | #define TOOSMALL 2 | 25 | #define TOOSMALL 2 |
26 | #define TOOLARGE 3 | 26 | #define TOOLARGE 3 |
27 | 27 | ||
28 | long long | 28 | long long |
29 | strtonum(const char *numstr, long long minval, long long maxval, | 29 | strtonum(const char *numstr, long long minval, long long maxval, |
30 | const char **errstrp) | 30 | const char **errstrp) |
31 | { | 31 | { |
32 | long long ll = 0; | 32 | long long ll = 0; |
33 | char *ep; | ||
34 | int error = 0; | 33 | int error = 0; |
34 | char *ep; | ||
35 | struct errval { | 35 | struct errval { |
36 | const char *errstr; | 36 | const char *errstr; |
37 | int err; | 37 | int err; |
@@ -44,9 +44,9 @@ strtonum(const char *numstr, long long minval, long long maxval, | |||
44 | 44 | ||
45 | ev[0].err = errno; | 45 | ev[0].err = errno; |
46 | errno = 0; | 46 | errno = 0; |
47 | if (minval > maxval) | 47 | if (minval > maxval) { |
48 | error = INVALID; | 48 | error = INVALID; |
49 | else { | 49 | } else { |
50 | ll = strtoll(numstr, &ep, 10); | 50 | ll = strtoll(numstr, &ep, 10); |
51 | if (numstr == ep || *ep != '\0') | 51 | if (numstr == ep || *ep != '\0') |
52 | error = INVALID; | 52 | error = INVALID; |