From 5322410ec35dce160b10f5d401c38319421efe05 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 4 Dec 2007 00:58:51 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6482 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_utils.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index ca1ae36d91..fe3344b4f9 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -670,17 +670,9 @@ static char RFC2833_CHARS[] = "0123456789*#ABCDF"; SWITCH_DECLARE(char *) get_addr(char *buf, switch_size_t len, struct in_addr *in) { - uint8_t x, *i; - char *p = buf; - - - i = (uint8_t *) in; - - memset(buf, 0, len); - for (x = 0; x < 4; x++) { - sprintf(p, "%u%s", i[x], x == 3 ? "" : "."); - p = buf + strlen(buf); - } + assert(buf); + *buf = '\0'; + inet_ntop(AF_INET, in, buf, len); return buf; }