]> git.saurik.com Git - apple/libc.git/blob - net/FreeBSD/inet_addr.c.patch
Libc-391.tar.gz
[apple/libc.git] / net / FreeBSD / inet_addr.c.patch
1 --- inet_addr.c.orig 2003-05-20 15:22:14.000000000 -0700
2 +++ inet_addr.c 2005-02-24 17:08:54.000000000 -0800
3 @@ -61,6 +61,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/net/inet_addr.c,v 1.16 2002/04/19 04:46:20 suz Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <sys/param.h>
10
11 #include <netinet/in.h>
12 @@ -103,6 +105,7 @@
13 char *c;
14 char *endptr;
15 int gotend, n;
16 + locale_t loc = __current_locale();
17
18 c = (char *)cp;
19 n = 0;
20 @@ -113,7 +116,7 @@
21 gotend = 0;
22 while (!gotend) {
23 errno = 0;
24 - val = strtoul(c, &endptr, 0);
25 + val = strtoul_l(c, &endptr, 0, loc);
26
27 if (errno == ERANGE) /* Fail completely if it overflowed. */
28 return (0);
29 @@ -144,7 +147,7 @@
30 break;
31
32 default:
33 - if (isspace((unsigned char)*c)) {
34 + if (isspace_l((unsigned char)*c, loc)) {
35 gotend = 1;
36 break;
37 } else