summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-05 20:53:15 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-05 20:53:15 +0000
commit64f4cc701fb78e585514eaa894dfd98cbbf224bf (patch)
tree01c694992c4eb8968c0f6ffcd126a9c7f6633895 /src/login/login.c
parent01368ed9a40bc98ac870b04380ad1344485962e4 (diff)
downloadhercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.gz
hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.bz2
hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.xz
hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.zip
Fixing several compilation & runtime problems
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10164 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 7b6e96f40..c43db8990 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -388,13 +388,13 @@ int check_ipmask(uint32 ip, const unsigned char *str)
unsigned char *p = (unsigned char *)&ip2, *p2 = (unsigned char *)&mask;
// scan ip address
- if (sscanf((const char*)str, "%d.%d.%d.%d/%n", &p[3], &p[2], &p[1], &p[0], &i) != 4 || i == 0)
+ if (sscanf((const char*)str, "%u.%u.%u.%u/%n", &p[3], &p[2], &p[1], &p[0], &i) != 4 || i == 0)
return 0;
// scan mask
- if (sscanf((const char*)str+i, "%d.%d.%d.%d", &p2[3], &p2[2], &p2[1], &p2[0]) == 4) {
+ if (sscanf((const char*)str+i, "%u.%u.%u.%u", &p2[3], &p2[2], &p2[1], &p2[0]) == 4) {
;
- } else if (sscanf((const char*)(str+i), "%d", &m) == 1 && m >= 0 && m <= 32) {
+ } else if (sscanf((const char*)(str+i), "%u", &m) == 1 && m >= 0 && m <= 32) {
for(i = 0; i < m && i < 32; i++)
mask |= (1 << i);
} else {
@@ -3108,7 +3108,7 @@ int parse_login(int fd)
WFIFOHEAD(fd, 47+32*MAX_SERVERS);
for(i = 0; i < MAX_SERVERS; i++) {
if (server_fd[i] >= 0) {
- // Advanced subnet check [LuzZza]
+ // Advanced subnet check [LuzZza]
uint32 subnet_char_ip = lan_subnetcheck(ipl);
WFIFOL(fd,47+server_num*32) = (subnet_char_ip) ? htonl(subnet_char_ip) : htonl(server[i].ip);
WFIFOW(fd,47+server_num*32+4) = server[i].port; // /!\ must be sent in intel host byte order /!\ (client bug)