From 885e369762d299d1edfc3b662fc0dac1afcc6a38 Mon Sep 17 00:00:00 2001 From: pfg Date: Sat, 16 Aug 2014 01:03:51 +0000 Subject: MFC r269901: Minor style tweaks. Obtained from: OpenBSD (CVS rev. 1.7) --- lib/libc/stdlib/strtonum.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdlib/strtonum.c b/lib/libc/stdlib/strtonum.c index 6dccd97..aa433d8 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 @@ -24,17 +24,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; @@ -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; -- cgit v1.1