git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6482 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-12-04 00:58:51 +00:00
parent 1bbb57a82c
commit 5322410ec3
1 changed files with 3 additions and 11 deletions

View File

@ -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;
}