1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

s/guint32/in_addr_t/ actually.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2917 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-09-14 00:42:37 +00:00 committed by cras
parent 9805841e61
commit c5095a422c

View File

@ -158,7 +158,7 @@ DCC_REC *dcc_find_request(int type, const char *nick, const char *arg)
void dcc_ip2str(IPADDR *ip, char *host) void dcc_ip2str(IPADDR *ip, char *host)
{ {
IPADDR temp_ip; IPADDR temp_ip;
guint32 addr; in_addr_t addr;
if (*settings_get_str("dcc_own_ip") != '\0') { if (*settings_get_str("dcc_own_ip") != '\0') {
/* overridden IP address */ /* overridden IP address */
@ -170,7 +170,7 @@ void dcc_ip2str(IPADDR *ip, char *host)
/* IPv6 */ /* IPv6 */
net_ip2host(ip, host); net_ip2host(ip, host);
} else { } else {
memcpy(&addr, &ip->ip, 4); memcpy(&addr, &ip->ip, sizeof(addr));
g_snprintf(host, MAX_IP_LEN, "%lu", g_snprintf(host, MAX_IP_LEN, "%lu",
(unsigned long) htonl(addr)); (unsigned long) htonl(addr));
} }
@ -178,14 +178,14 @@ void dcc_ip2str(IPADDR *ip, char *host)
void dcc_str2ip(const char *str, IPADDR *ip) void dcc_str2ip(const char *str, IPADDR *ip)
{ {
guint32 addr; in_addr_t addr;
if (strchr(str, ':') == NULL) { if (strchr(str, ':') == NULL) {
/* normal IPv4 address in 32bit number form */ /* normal IPv4 address in 32bit number form */
addr = strtoul(str, NULL, 10); addr = strtoul(str, NULL, 10);
ip->family = AF_INET; ip->family = AF_INET;
addr = (guint32) ntohl(addr); addr = (guint32) ntohl(addr);
memcpy(&ip->ip, &addr, 4); memcpy(&ip->ip, &addr, sizeof(addr));
} else { } else {
/* IPv6 - in standard form */ /* IPv6 - in standard form */
net_host2ip(str, ip); net_host2ip(str, ip);