]> git.saurik.com Git - apple/libc.git/blob - net/FreeBSD/nsap_addr.c.patch
de8ca81ab37780a52e9f2050878030cd9f7688e0
[apple/libc.git] / net / FreeBSD / nsap_addr.c.patch
1 --- nsap_addr.c.orig 2008-09-01 21:04:36.000000000 -0700
2 +++ nsap_addr.c 2008-09-01 21:11:10.000000000 -0700
3 @@ -17,6 +17,10 @@
4
5 #if defined(LIBC_SCCS) && !defined(lint)
6 static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $";
7 +
8 +/* the algorithms only can deal with ASCII, so we optimize for it */
9 +#define USE_ASCII
10 +
11 #endif /* LIBC_SCCS and not lint */
12 #include <sys/cdefs.h>
13 __FBSDID("$FreeBSD: src/lib/libc/inet/nsap_addr.c,v 1.3 2007/06/03 17:20:26 ume Exp $");
14 @@ -33,10 +37,12 @@ __FBSDID("$FreeBSD: src/lib/libc/inet/ns
15
16 #include <ctype.h>
17 #include <resolv.h>
18 -#include <resolv_mt.h>
19 +//#include <resolv_mt.h>
20
21 #include "port_after.h"
22
23 +#include <stdlib.h>
24 +
25 static char
26 xtob(int c) {
27 return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
28 @@ -82,9 +88,13 @@ char *
29 inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
30 int nib;
31 int i;
32 - char *tmpbuf = inet_nsap_ntoa_tmpbuf;
33 + char *tmpbuf = NULL;
34 char *start;
35
36 + if (tmpbuf == NULL) {
37 + tmpbuf = malloc(255*3);
38 + if (tmpbuf == NULL) return NULL;
39 + }
40 if (ascii)
41 start = ascii;
42 else {