summaryrefslogtreecommitdiff
path: root/libc/inet/addr.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-06-17 21:15:35 +0000
committerEric Andersen <andersen@codepoet.org>2002-06-17 21:15:35 +0000
commit3aabbb4ab12be066b20c5fe8e5fc25c1ff084564 (patch)
tree98c78666dcffa6e9338bce667fc80eda6bda984d /libc/inet/addr.c
parentcdb3c81f36283df4b53f24a374d78c695e9d8b06 (diff)
Make things more re-entrany, kill some cruft.
-Erik
Diffstat (limited to 'libc/inet/addr.c')
-rw-r--r--libc/inet/addr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index 6b143c6ba..9abf7c44d 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -85,12 +85,8 @@ const char *cp;
#endif
#ifdef L_inet_ntoa
-
-char *inet_ntoa(in)
-struct in_addr in;
+char *inet_ntoa_r(struct in_addr in, char buf[16])
{
- static char buf[16]; /* max 12 digits + 3 '.'s + 1 nul */
-
unsigned long addr = ntohl(in.s_addr);
int i;
char *p, *q;
@@ -108,6 +104,12 @@ struct in_addr in;
return p+1;
}
+
+char *inet_ntoa(struct in_addr in)
+{
+ static char buf[16]; /* max 12 digits + 3 '.'s + 1 nul */
+ return(inet_ntoa_r(in, buf));
+}
#endif
#ifdef L_inet_makeaddr