diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
commit | 71cd8e3a743046573744123777061b64881bf372 (patch) | |
tree | 82522befe647f4fff186a5630cad0cad33f8ef53 /lib/xstrtol.c | |
parent | c18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff) | |
download | coreutils-upstream.tar.gz |
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'lib/xstrtol.c')
-rw-r--r-- | lib/xstrtol.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/xstrtol.c b/lib/xstrtol.c index f6d535a7..bd3ffeb2 100644 --- a/lib/xstrtol.c +++ b/lib/xstrtol.c @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2014 Free Software + Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -34,13 +34,13 @@ need stderr defined if assertion checking is enabled. */ #include <stdio.h> -#include <assert.h> #include <ctype.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #include <string.h> +#include "assure.h" #include "intprops.h" /* xstrtoll.c and xstrtoull.c, which include this file, require that @@ -93,10 +93,12 @@ __xstrtol (const char *s, char **ptr, int strtol_base, __strtol_t tmp; strtol_error err = LONGINT_OK; - assert (0 <= strtol_base && strtol_base <= 36); + assure (0 <= strtol_base && strtol_base <= 36); p = (ptr ? ptr : &t_ptr); + errno = 0; + if (! TYPE_SIGNED (__strtol_t)) { const char *q = s; @@ -107,7 +109,6 @@ __xstrtol (const char *s, char **ptr, int strtol_base, return LONGINT_INVALID; } - errno = 0; tmp = __strtol (s, p, strtol_base); if (*p == s) |