summaryrefslogtreecommitdiff
path: root/libc/inet/addr.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-03-12 01:18:50 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-03-12 01:18:50 +0000
commit03e039820dc5092e27e81f3671652f25da7f25f1 (patch)
tree37bddad6951b8a6aa5d75184353705f672217812 /libc/inet/addr.c
parentff3e48d94097ed02480bb0df538620b221ccd72f (diff)
Swap in the new stdio code.
Diffstat (limited to 'libc/inet/addr.c')
-rw-r--r--libc/inet/addr.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index d1f9c04e6..6b143c6ba 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -10,10 +10,16 @@
* are smaller than the previous functions and don't require static buffers.
* In the process, removed the reference to strcat and cut object size of
* inet_ntoa in half (from 190 bytes down to 94).
+ *
+ * Manuel Novoa III Feb 2002
+ *
+ * Changed to use _int10tostr.
*/
#define __FORCE_GLIBC
#include <features.h>
+#define _STDIO_UTILITY /* For _int10tostr. */
+#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <netinet/in.h>
@@ -80,15 +86,6 @@ const char *cp;
#ifdef L_inet_ntoa
-#include <limits.h>
-
-#if (ULONG_MAX >> 32)
-/* We're set up for 32 bit unsigned longs */
-#error need to check size allocation for static buffer 'buf'
-#endif
-
-extern char *__ultostr(char *buf, unsigned long uval, int base, int uppercase);
-
char *inet_ntoa(in)
struct in_addr in;
{
@@ -101,7 +98,7 @@ struct in_addr in;
q = 0;
p = buf + sizeof(buf) - 1;
for (i=0 ; i < 4 ; i++ ) {
- p = __ultostr(p, addr & 0xff, 10, 0 ) - 1;
+ p = _int10tostr(p, addr & 0xff) - 1;
addr >>= 8;
if (q) {
*q = '.';