comparison libpurple/protocols/bonjour/jabber.c @ 21440:d8106b63b0a4

I thought I was just fixing a leak in this commit, but it turns out I forgot to add the new files in the previous commit.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 12 Nov 2007 04:17:10 +0000
parents db7fa42845f6
children da75dd6c41fb
comparison
equal deleted inserted replaced
21439:8fbd51946259 21440:d8106b63b0a4
1014 if (ret == -1) 1014 if (ret == -1)
1015 return -1; 1015 return -1;
1016 return 0; 1016 return 0;
1017 } 1017 }
1018 1018
1019 /* This returns a ';' delimited string containing all non-localhost IPs */
1019 char * 1020 char *
1020 purple_network_get_my_ip_ext2(int fd) 1021 purple_network_get_my_ip_ext2(int fd)
1021 { 1022 {
1022 char buffer[1024]; 1023 char buffer[1024];
1023 static char ip_ext[17 * 10]; 1024 static char ip_ext[17 * 10];
1038 ifc.ifc_req = (struct ifreq *)buffer; 1039 ifc.ifc_req = (struct ifreq *)buffer;
1039 ioctl(source, SIOCGIFCONF, &ifc); 1040 ioctl(source, SIOCGIFCONF, &ifc);
1040 1041
1041 if (fd < 0) 1042 if (fd < 0)
1042 close(source); 1043 close(source);
1043 memset(ip_ext, 0, 17 * 10); 1044
1045 memset(ip_ext, 0, sizeof(ip_ext));
1044 memcpy(ip_ext, "0.0.0.0", 7); 1046 memcpy(ip_ext, "0.0.0.0", 7);
1045 tmp = buffer; 1047 tmp = buffer;
1046 tip = ip_ext; 1048 tip = ip_ext;
1047 while (tmp < buffer + ifc.ifc_len) 1049 while (tmp < buffer + ifc.ifc_len)
1048 { 1050 {