Mercurial > pidgin.yaz
changeset 12770:ab00cea25ef2
[gaim-migrate @ 15117]
I think this is what was actually intended in get_my_ip(). Likewise with simple_udp_process(), although I don't think it'd be possible to use that extra byte anyway.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 09 Jan 2006 03:36:45 +0000 |
parents | a90255f67652 |
children | d45ed81f7ff0 |
files | src/protocols/simple/simple.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/simple/simple.c Sun Jan 08 22:50:34 2006 +0000 +++ b/src/protocols/simple/simple.c Mon Jan 09 03:36:45 2006 +0000 @@ -68,8 +68,7 @@ if(!tmp || !strcmp(tmp,"0.0.0.0")) { tmp = gaim_network_get_my_ip(-1); } - if(!tmp) strcpy(my_ip, "0.0.0.0"); - strcpy(my_ip, tmp); + strcpy(my_ip, tmp ? tmp : "0.0.0.0"); return my_ip; } @@ -1113,7 +1112,7 @@ time_t currtime; static char buffer[65536]; - if((len = recv(source, buffer, 65536, 0)) > 0) { + if((len = recv(source, buffer, sizeof(buffer) - 1, 0)) > 0) { buffer[len] = '\0'; gaim_debug_info("simple","\n\nreceived - %s\n######\n%s\n#######\n\n",ctime(&currtime), buffer); msg = sipmsg_parse_msg(buffer);