mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
DCC was broken with some 64bit systems (64bit unsigned long)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2916 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3f57df52c8
commit
9805841e61
@ -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;
|
||||
unsigned long addr;
|
||||
guint32 addr;
|
||||
|
||||
if (*settings_get_str("dcc_own_ip") != '\0') {
|
||||
/* overridden IP address */
|
||||
@ -178,13 +178,13 @@ void dcc_ip2str(IPADDR *ip, char *host)
|
||||
|
||||
void dcc_str2ip(const char *str, IPADDR *ip)
|
||||
{
|
||||
unsigned long addr;
|
||||
guint32 addr;
|
||||
|
||||
if (strchr(str, ':') == NULL) {
|
||||
/* normal IPv4 address in 32bit number form */
|
||||
addr = strtoul(str, NULL, 10);
|
||||
ip->family = AF_INET;
|
||||
addr = (unsigned long) ntohl(addr);
|
||||
addr = (guint32) ntohl(addr);
|
||||
memcpy(&ip->ip, &addr, 4);
|
||||
} else {
|
||||
/* IPv6 - in standard form */
|
||||
|
Loading…
Reference in New Issue
Block a user