diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-03-02 11:38:45 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-03-02 11:38:45 +0000 |
commit | ecc323148c09620fce327884e4fa6bd922c34ebc (patch) | |
tree | 2833d1ded21dc4fd30bd7ac1281abb8ba47ce09f /network_io | |
parent | 771dff6d0ebc20b9341ad6bc26ef8e2ca337d6de (diff) | |
download | libapr-ecc323148c09620fce327884e4fa6bd922c34ebc.tar.gz |
use apr_snprintf() instead of sprintf()... glibc_r sprintf()
makes extra syscalls grabbing/releasing a mutex for unknown
reasons
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61333 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/inet_ntop.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 6360b6aba..6f9d2fee3 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -49,8 +49,6 @@ #define EAFNOSUPPORT WSAEAFNOSUPPORT #endif -#define SPRINTF(x) ((apr_size_t)sprintf x) - /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. @@ -106,7 +104,7 @@ inet_ntop4(src, dst, size) static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; - if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) { + if (apr_snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]) > size) { errno = ENOSPC; return (NULL); } @@ -193,7 +191,7 @@ inet_ntop6(src, dst, size) tp += strlen(tp); break; } - tp += SPRINTF((tp, "%x", words[i])); + tp += apr_snprintf(tp, sizeof tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) |