X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/7b00c0c43f52e9d27168e67a26aac19065cdb40c..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/net/FreeBSD/nsap_addr.c diff --git a/net/FreeBSD/nsap_addr.c b/net/FreeBSD/nsap_addr.c index fd34e0e..5bf73e5 100644 --- a/net/FreeBSD/nsap_addr.c +++ b/net/FreeBSD/nsap_addr.c @@ -17,6 +17,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $"; + +/* the algorithms only can deal with ASCII, so we optimize for it */ +#define USE_ASCII + #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD: src/lib/libc/inet/nsap_addr.c,v 1.3 2007/06/03 17:20:26 ume Exp $"); @@ -33,10 +37,12 @@ __FBSDID("$FreeBSD: src/lib/libc/inet/nsap_addr.c,v 1.3 2007/06/03 17:20:26 ume #include #include -#include +//#include #include "port_after.h" +#include + static char xtob(int c) { return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); @@ -82,9 +88,13 @@ char * inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) { int nib; int i; - char *tmpbuf = inet_nsap_ntoa_tmpbuf; + char *tmpbuf = NULL; char *start; + if (tmpbuf == NULL) { + tmpbuf = malloc(255*3); + if (tmpbuf == NULL) return NULL; + } if (ascii) start = ascii; else {