summaryrefslogtreecommitdiffstats
path: root/freebsd/lib/libc/stdlib/strtonum.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/lib/libc/stdlib/strtonum.c')
-rw-r--r--freebsd/lib/libc/stdlib/strtonum.c14
1 files changed, 7 insertions, 7 deletions
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 <sys/cdefs.h>
@@ -26,17 +26,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;
@@ -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;