mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -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:
parent
9805841e61
commit
c5095a422c
@ -158,7 +158,7 @@ DCC_REC *dcc_find_request(int type, const char *nick, const char *arg)
|
||||
void dcc_ip2str(IPADDR *ip, char *host)
|
||||
{
|
||||
IPADDR temp_ip;
|
||||
guint32 addr;
|
||||
in_addr_t addr;
|
||||
|
||||
if (*settings_get_str("dcc_own_ip") != '\0') {
|
||||
/* overridden IP address */
|
||||
@ -170,7 +170,7 @@ void dcc_ip2str(IPADDR *ip, char *host)
|
||||
/* IPv6 */
|
||||
net_ip2host(ip, host);
|
||||
} else {
|
||||
memcpy(&addr, &ip->ip, 4);
|
||||
memcpy(&addr, &ip->ip, sizeof(addr));
|
||||
g_snprintf(host, MAX_IP_LEN, "%lu",
|
||||
(unsigned long) htonl(addr));
|
||||
}
|
||||
@ -178,14 +178,14 @@ void dcc_ip2str(IPADDR *ip, char *host)
|
||||
|
||||
void dcc_str2ip(const char *str, IPADDR *ip)
|
||||
{
|
||||
guint32 addr;
|
||||
in_addr_t addr;
|
||||
|
||||
if (strchr(str, ':') == NULL) {
|
||||
/* normal IPv4 address in 32bit number form */
|
||||
addr = strtoul(str, NULL, 10);
|
||||
ip->family = AF_INET;
|
||||
addr = (guint32) ntohl(addr);
|
||||
memcpy(&ip->ip, &addr, 4);
|
||||
memcpy(&ip->ip, &addr, sizeof(addr));
|
||||
} else {
|
||||
/* IPv6 - in standard form */
|
||||
net_host2ip(str, ip);
|
||||
|
Loading…
Reference in New Issue
Block a user