Loading...
--- Libc/Libc-1725.40.4/stdlib/FreeBSD/strtoumax.c
+++ Libc/Libc-498/stdlib/FreeBSD/strtoumax.c
@@ -10,6 +10,10 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -31,9 +35,7 @@
static char sccsid[] = "from @(#)strtoul.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.11 2007/01/09 00:28:10 imp Exp $");
-
-#include "xlocale_private.h"
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.8 2002/09/06 11:23:59 tjr Exp $");
#include <ctype.h>
#include <errno.h>
@@ -47,8 +49,7 @@
* alphabets and digits are each contiguous.
*/
uintmax_t
-strtoumax_l(const char * __restrict nptr, char ** __restrict endptr, int base,
- locale_t loc)
+strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base)
{
const char *s;
uintmax_t acc;
@@ -56,14 +57,13 @@
uintmax_t cutoff;
int neg, any, cutlim;
- NORMALIZE_LOCALE(loc);
/*
* See strtoimax for comments as to the logic used.
*/
s = nptr;
do {
c = *s++;
- } while (isspace_l((unsigned char)c, loc));
+ } while (isspace((unsigned char)c));
if (c == '-') {
neg = 1;
c = *s++;
@@ -73,10 +73,7 @@
c = *s++;
}
if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'A' && s[1] <= 'F') ||
- (s[1] >= 'a' && s[1] <= 'f'))) {
+ c == '0' && (*s == 'x' || *s == 'X')) {
c = s[1];
s += 2;
base = 16;
@@ -120,9 +117,3 @@
*endptr = (char *)(any ? s - 1 : nptr);
return (acc);
}
-
-uintmax_t
-strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base)
-{
- return strtoumax_l(nptr, endptr, base, __current_locale());
-}