summaryrefslogtreecommitdiff
path: root/lib/inet_ntop.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2005-03-16 02:25:12 +0000
committerDan Fandrich <dan@coneharvesters.com>2005-03-16 02:25:12 +0000
commitbf87d13f5b94aed8876d2c950faeadf7e6636128 (patch)
tree763f1e19027c1f40f1847048131fc73c0dceee99 /lib/inet_ntop.c
parentefaf6886505cd29084af05aa06edc19fd71bdfe9 (diff)
downloadcurl-bf87d13f5b94aed8876d2c950faeadf7e6636128.tar.gz
Fixed some compiler warnings I should have noticed before.
Diffstat (limited to 'lib/inet_ntop.c')
-rw-r--r--lib/inet_ntop.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index 293723a7e..6e4b38b1d 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -54,17 +54,13 @@
* - uses no statics
* - takes a u_char* not an in_addr as input
*/
-static const char *inet_ntop4 (const u_char *src, char *dst, size_t size)
+static char *inet_ntop4 (const u_char *src, char *dst, size_t size)
{
#if defined(HAVE_INET_NTOA_R_2_ARGS)
const char *ptr;
- size_t len;
curlassert(size >= 16);
ptr = inet_ntoa_r(*(struct in_addr*)src, dst);
- len = strlen(ptr);
- memmove(dst, ptr, len);
- dst[len] = 0;
- return dst;
+ return (char *)memmove(dst, ptr, strlen(ptr)+1);
#elif defined(HAVE_INET_NTOA_R)
return inet_ntoa_r(*(struct in_addr*)src, dst, size);
@@ -85,7 +81,7 @@ static const char *inet_ntop4 (const u_char *src, char *dst, size_t size)
/*
* Convert IPv6 binary address into presentation (printable) format.
*/
-static const char *inet_ntop6 (const u_char *src, char *dst, size_t size)
+static char *inet_ntop6 (const u_char *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
@@ -189,10 +185,10 @@ static const char *inet_ntop6 (const u_char *src, char *dst, size_t size)
/*
* Convert a network format address to presentation format.
*
- * Returns pointer to presentation format address (`dst'),
+ * Returns pointer to presentation format address (`buf'),
* Returns NULL on error (see errno).
*/
-const char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
+char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
{
switch (af) {
case AF_INET: