summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 02:58:06 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 02:58:06 +0000
commit230ba4e3dd84a19f7dee67fdc97532e5869bef63 (patch)
treece45bbd4ee391c864da8c4d26ec786e7fd1e15b2
parent8766394782084eef1b77d39f5b8e54947847735f (diff)
downloadhercules-230ba4e3dd84a19f7dee67fdc97532e5869bef63.tar.gz
hercules-230ba4e3dd84a19f7dee67fdc97532e5869bef63.tar.bz2
hercules-230ba4e3dd84a19f7dee67fdc97532e5869bef63.tar.xz
hercules-230ba4e3dd84a19f7dee67fdc97532e5869bef63.zip
More ANSI C++/C conformance fixes [SVN 1341: MouseJstr]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1341 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-SVN.txt1
-rw-r--r--src/char/char.c12
-rw-r--r--src/char/int_guild.c4
-rw-r--r--src/char/int_party.c2
-rw-r--r--src/char/int_pet.c2
-rw-r--r--src/char/int_storage.c4
-rw-r--r--src/char/inter.c4
-rw-r--r--src/ladmin/ladmin.c4
-rw-r--r--src/login/login.c98
9 files changed, 66 insertions, 65 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index c78a3fad3..cf19bf917 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -6,6 +6,7 @@ Date Added
upgrade your mysql as a result of the new adoption system. Thank you
-MouseJstr
+ * More ANSI C++/C conformance fixes [SVN 1341: MouseJstr]
* Fixed SQL char server crashing when loading the item_db, my bad ^^; [celest]
* More ANSI C++/C conformance fixes [SVN 1334: MouseJstr]
* Added auto save guild data (only guardian HP and owner guild ID for now,
diff --git a/src/char/char.c b/src/char/char.c
index 0b8c3c9d9..b2fc12ddb 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -840,7 +840,7 @@ int make_new_char(int fd, unsigned char *dat) {
// remove control characters from the name
dat[23] = '\0';
- if (remove_control_chars((char*)dat)) {
+ if (remove_control_chars((unsigned char *)(char*)dat)) {
char_log("Make new char error (control char received in the name): (connection #%d, account: %d)." RETCODE,
fd, sd->account_id);
return -1;
@@ -1828,7 +1828,7 @@ int parse_tologin(int fd) {
memset(message, '\0', sizeof(message));
memcpy(message, RFIFOP(fd,8), RFIFOL(fd,4));
message[sizeof(message)-1] = '\0';
- remove_control_chars(message);
+ remove_control_chars((unsigned char *)message);
// remove all first spaces
p = message;
while(p[0] == ' ')
@@ -3190,8 +3190,8 @@ int lan_config_read(const char *lancfgName) {
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
continue;
- remove_control_chars(w1);
- remove_control_chars(w2);
+ remove_control_chars((unsigned char *)w1);
+ remove_control_chars((unsigned char *)w2);
if (strcmpi(w1, "lan_map_ip") == 0) { // Read map-server Lan IP Address
h = gethostbyname(w2);
if (h != NULL) {
@@ -3262,8 +3262,8 @@ int char_config_read(const char *cfgName) {
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
continue;
- remove_control_chars(w1);
- remove_control_chars(w2);
+ remove_control_chars((unsigned char *)w1);
+ remove_control_chars((unsigned char *)w2);
if (strcmpi(w1, "userid") == 0) {
memcpy(userid, w2, 24);
} else if (strcmpi(w1, "passwd") == 0) {
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 78e6b476f..8b9de1a89 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -490,13 +490,13 @@ int inter_guild_init() {
int castle_db_final (void *k, void *data, va_list ap)
{
- struct guild_castle *gc = data;
+ struct guild_castle *gc = (struct guild_castle *) data;
if (gc) aFree(gc);
return 0;
}
int guild_db_final (void *k, void *data, va_list ap)
{
- struct guild *g = data;
+ struct guild *g = (struct guild *) data;
if (g) aFree(g);
return 0;
}
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 5ee48fc70..8c87f2cb4 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -118,7 +118,7 @@ int inter_party_init() {
}
int party_db_final (void *k, void *data, va_list ap) {
- struct party *p = data;
+ struct party *p = (struct party *) data;
if (p) aFree(p);
return 0;
}
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 342854f8b..ab53d0533 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -110,7 +110,7 @@ int inter_pet_init()
}
int pet_db_final (void *k, void *data, va_list ap) {
- struct s_pet *p = data;
+ struct s_pet *p = (struct s_pet *) data;
if (p) aFree(p);
return 0;
}
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 498004bc0..eaf9e001a 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -292,12 +292,12 @@ int inter_storage_init()
}
int storage_db_final (void *k, void *data, va_list ap) {
- struct storage *p = data;
+ struct storage *p = (struct storage *) data;
if (p) aFree(p);
return 0;
}
int guild_storage_db_final (void *k, void *data, va_list ap) {
- struct guild_storage *p = data;
+ struct guild_storage *p = (struct guild_storage *) data;
if (p) aFree(p);
return 0;
}
diff --git a/src/char/inter.c b/src/char/inter.c
index 3a388ea82..a6893aecc 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -263,12 +263,12 @@ int inter_init(const char *file) {
// finalize
int accreg_db_final (void *k, void *data, va_list ap) {
- struct accreg *p = data;
+ struct accreg *p = (struct accreg *) data;
if (p) aFree(p);
return 0;
}
int wis_db_final (void *k, void *data, va_list ap) {
- struct WisData *p = data;
+ struct WisData *p = (struct WisData *) data;
if (p) aFree(p);
return 0;
}
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index 0453efa1d..432a78a95 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -4256,8 +4256,8 @@ int ladmin_config_read(const char *cfgName) {
line[sizeof(line)-1] = '\0';
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2) {
- remove_control_chars(w1);
- remove_control_chars(w2);
+ remove_control_chars((unsigned char *) w1);
+ remove_control_chars((unsigned char *) w2);
if(strcmpi(w1,"login_ip")==0){
struct hostent *h = gethostbyname (w2);
diff --git a/src/login/login.c b/src/login/login.c
index 27f7c12ce..747fe0a94 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -588,7 +588,7 @@ int mmo_auth_init(void) {
continue;
}
userid[23] = '\0';
- remove_control_chars(userid);
+ remove_control_chars((unsigned char *)userid);
for(j = 0; j < auth_num; j++) {
if (auth_dat[j].account_id == account_id) {
printf("\033[1;31mmmo_auth_init: ******Error: an account has an identical id to another.\n");
@@ -622,11 +622,11 @@ int mmo_auth_init(void) {
strncpy(auth_dat[auth_num].userid, userid, 24);
pass[23] = '\0';
- remove_control_chars(pass);
+ remove_control_chars((unsigned char *)pass);
strncpy(auth_dat[auth_num].pass, pass, 24);
lastlogin[23] = '\0';
- remove_control_chars(lastlogin);
+ remove_control_chars((unsigned char *)lastlogin);
strncpy(auth_dat[auth_num].lastlogin, lastlogin, 24);
auth_dat[auth_num].sex = (sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm');
@@ -647,12 +647,12 @@ int mmo_auth_init(void) {
printf("Account %s (%d): invalid e-mail (replaced par a@a.com).\n", auth_dat[auth_num].userid, auth_dat[auth_num].account_id);
strncpy(auth_dat[auth_num].email, "a@a.com", 40);
} else {
- remove_control_chars(email);
+ remove_control_chars((unsigned char *)email);
strncpy(auth_dat[auth_num].email, email, 40);
}
error_message[19] = '\0';
- remove_control_chars(error_message);
+ remove_control_chars((unsigned char *)error_message);
if (error_message[0] == '\0' || state != 7) { // 7, because state is packet 0x006a value + 1
strncpy(auth_dat[auth_num].error_message, "-", 20);
} else {
@@ -667,11 +667,11 @@ int mmo_auth_init(void) {
auth_dat[auth_num].connect_until_time = connect_until_time;
last_ip[15] = '\0';
- remove_control_chars(last_ip);
+ remove_control_chars((unsigned char *)last_ip);
strncpy(auth_dat[auth_num].last_ip, last_ip, 16);
memo[254] = '\0';
- remove_control_chars(memo);
+ remove_control_chars((unsigned char *)memo);
strncpy(auth_dat[auth_num].memo, memo, 255);
for(j = 0; j < ACCOUNT_REG2_NUM; j++) {
@@ -686,7 +686,7 @@ int mmo_auth_init(void) {
break;
}
str[31] = '\0';
- remove_control_chars(str);
+ remove_control_chars((unsigned char *)str);
strncpy(auth_dat[auth_num].account_reg2[j].str, str, 32);
auth_dat[auth_num].account_reg2[j].value = v;
}
@@ -713,7 +713,7 @@ int mmo_auth_init(void) {
continue;
}
userid[23] = '\0';
- remove_control_chars(userid);
+ remove_control_chars((unsigned char *)userid);
for(j = 0; j < auth_num; j++) {
if (auth_dat[j].account_id == account_id) {
printf("\033[1;31mmmo_auth_init: ******Error: an account has an identical id to another.\n");
@@ -747,11 +747,11 @@ int mmo_auth_init(void) {
strncpy(auth_dat[auth_num].userid, userid, 24);
pass[23] = '\0';
- remove_control_chars(pass);
+ remove_control_chars((unsigned char *)pass);
strncpy(auth_dat[auth_num].pass, pass, 24);
lastlogin[23] = '\0';
- remove_control_chars(lastlogin);
+ remove_control_chars((unsigned char *)lastlogin);
strncpy(auth_dat[auth_num].lastlogin, lastlogin, 24);
auth_dat[auth_num].sex = (sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm');
@@ -794,7 +794,7 @@ int mmo_auth_init(void) {
break;
}
str[31] = '\0';
- remove_control_chars(str);
+ remove_control_chars((unsigned char *)str);
strncpy(auth_dat[auth_num].account_reg2[j].str, str, 32);
auth_dat[auth_num].account_reg2[j].value = v;
}
@@ -1406,7 +1406,7 @@ int parse_fromchar(int fd) {
acc = RFIFOL(fd,2); // speed up
memcpy(email, RFIFOP(fd,6), 40);
email[39] = '\0';
- remove_control_chars(email);
+ remove_control_chars((unsigned char *)email);
//printf("parse_fromchar: an e-mail creation of an account with a default e-mail: server '%s', account: %d, e-mail: '%s'.\n", server[id].name, acc, RFIFOP(fd,6));
if (e_mail_check(email) == 0)
login_log("Char-server '%s': Attempt to create an e-mail on an account with a default e-mail REFUSED - e-mail is invalid (account: %d, ip: %s)" RETCODE,
@@ -1517,10 +1517,10 @@ int parse_fromchar(int fd) {
acc = RFIFOL(fd,2);
memcpy(actual_email, RFIFOP(fd,6), 40);
actual_email[39] = '\0';
- remove_control_chars(actual_email);
+ remove_control_chars((unsigned char *)actual_email);
memcpy(new_email, RFIFOP(fd,46), 40);
new_email[39] = '\0';
- remove_control_chars(new_email);
+ remove_control_chars((unsigned char *)new_email);
if (e_mail_check(actual_email) == 0)
login_log("Char-server '%s': Attempt to modify an e-mail on an account (@email GM command), but actual email is invalid (account: %d, ip: %s)" RETCODE,
server[id].name, acc, ip);
@@ -1715,7 +1715,7 @@ int parse_fromchar(int fd) {
for(p = 8, j = 0; p < RFIFOW(fd,2) && j < ACCOUNT_REG2_NUM; p += 36, j++) {
memcpy(auth_dat[i].account_reg2[j].str, RFIFOP(fd,p), 32);
auth_dat[i].account_reg2[j].str[31] = '\0';
- remove_control_chars(auth_dat[i].account_reg2[j].str);
+ remove_control_chars((unsigned char *)auth_dat[i].account_reg2[j].str);
auth_dat[i].account_reg2[j].value = RFIFOL(fd,p+32);
}
auth_dat[i].account_reg2_num = j;
@@ -1969,8 +1969,8 @@ int parse_admin(int fd) {
login_log("'ladmin': Attempt to create an account, but there is no more available id number (account: %s, pass: %s, sex: %c, ip: %s)" RETCODE,
ma.userid, ma.passwd, ma.sex, ip);
} else {
- remove_control_chars(ma.userid);
- remove_control_chars(ma.passwd);
+ remove_control_chars((unsigned char *)ma.userid);
+ remove_control_chars((unsigned char *)ma.passwd);
for(i = 0; i < auth_num; i++) {
if (strncmp(auth_dat[i].userid, ma.userid, 24) == 0) {
login_log("'ladmin': Attempt to create an already existing account (account: %s, pass: %s, received pass: %s, ip: %s)" RETCODE,
@@ -1983,7 +1983,7 @@ int parse_admin(int fd) {
char email[40];
memcpy(email, RFIFOP(fd,51), 40);
email[39] = '\0';
- remove_control_chars(email);
+ remove_control_chars((unsigned char *)email);
new_id = mmo_auth_new(&ma, ma.sex, email);
login_log("'ladmin': Account creation (account: %s (id: %d), pass: %s, sex: %c, email: %s, ip: %s)" RETCODE,
ma.userid, new_id, ma.passwd, ma.sex, auth_dat[i].email, ip);
@@ -2003,7 +2003,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF? an unsigned being set to -1
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
// Char-server is notified of deletion (for characters deletion).
@@ -2039,13 +2039,13 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; /// WTF??? an unsigned being set to a -1
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
memcpy(auth_dat[i].pass, RFIFOP(fd,26), 24);
auth_dat[i].pass[23] = '\0';
- remove_control_chars(auth_dat[i].pass);
+ remove_control_chars((unsigned char *)auth_dat[i].pass);
WFIFOL(fd,2) = auth_dat[i].account_id;
login_log("'ladmin': Modification of a password (account: %s, new password: %s, ip: %s)" RETCODE,
auth_dat[i].userid, auth_dat[i].pass, ip);
@@ -2069,11 +2069,11 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
statut = RFIFOL(fd,26);
memcpy(error_message, RFIFOP(fd,30), 20);
error_message[19] = '\0';
- remove_control_chars(error_message);
+ remove_control_chars((unsigned char *)error_message);
if (statut != 7 || error_message[0] == '\0') { // 7: // 6 = Your are Prohibited to log in until %s
strcpy(error_message, "-");
}
@@ -2144,14 +2144,14 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
char pass[25];
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
memcpy(pass, RFIFOP(fd,26), 24);
pass[24] = '\0';
- remove_control_chars(pass);
+ remove_control_chars((unsigned char *)pass);
if (strcmp(auth_dat[i].pass, pass) == 0) {
WFIFOL(fd,2) = auth_dat[i].account_id;
login_log("'ladmin': Check of password OK (account: %s, password: %s, ip: %s)" RETCODE,
@@ -2176,7 +2176,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
memcpy(WFIFOP(fd,6), account_name, 24);
{
char sex;
@@ -2228,7 +2228,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
memcpy(WFIFOP(fd,6), account_name, 24);
{
char new_gm_level;
@@ -2318,7 +2318,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
memcpy(WFIFOP(fd,6), account_name, 24);
{
char email[40];
@@ -2327,7 +2327,7 @@ int parse_admin(int fd) {
login_log("'ladmin': Attempt to give an invalid e-mail (account: %s, ip: %s)" RETCODE,
account_name, ip);
} else {
- remove_control_chars(email);
+ remove_control_chars((unsigned char *)email);
i = search_account_index(account_name);
if (i != -1) {
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
@@ -2353,7 +2353,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
int size_of_memo = sizeof(auth_dat[i].memo);
@@ -2367,7 +2367,7 @@ int parse_admin(int fd) {
memcpy(auth_dat[i].memo, RFIFOP(fd,28), RFIFOW(fd,26));
}
auth_dat[i].memo[size_of_memo - 1] = '\0';
- remove_control_chars(auth_dat[i].memo);
+ remove_control_chars((unsigned char *)auth_dat[i].memo);
WFIFOL(fd,2) = auth_dat[i].account_id;
login_log("'ladmin': Modification of a memo field (account: %s, new memo: %s, ip: %s)" RETCODE,
auth_dat[i].userid, auth_dat[i].memo, ip);
@@ -2388,7 +2388,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
@@ -2437,7 +2437,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
timestamp = (time_t)RFIFOL(fd,26);
strftime(tmpstr, 24, date_format, localtime(&timestamp));
i = search_account_index(account_name);
@@ -2469,7 +2469,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
timestamp = (time_t)RFIFOL(fd,26);
if (timestamp <= time(NULL))
timestamp = 0;
@@ -2517,7 +2517,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
WFIFOL(fd,2) = auth_dat[i].account_id;
@@ -2595,7 +2595,7 @@ int parse_admin(int fd) {
memset(message, '\0', sizeof(message));
memcpy(message, RFIFOP(fd,8), RFIFOL(fd,4));
message[sizeof(message)-1] = '\0';
- remove_control_chars(message);
+ remove_control_chars((unsigned char *)message);
if (RFIFOW(fd,2) == 0)
login_log("'ladmin': Receiving a message for broadcast (message (in yellow): %s, ip: %s)" RETCODE,
message, ip);
@@ -2624,7 +2624,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
WFIFOL(fd,2) = auth_dat[i].account_id;
@@ -2678,7 +2678,7 @@ int parse_admin(int fd) {
WFIFOL(fd,2) = -1; // WTF???
account_name = (char*)RFIFOP(fd,2);
account_name[23] = '\0';
- remove_control_chars(account_name);
+ remove_control_chars((unsigned char *)account_name);
i = search_account_index(account_name);
if (i != -1) {
WFIFOL(fd,2) = auth_dat[i].account_id;
@@ -2880,7 +2880,7 @@ int parse_login(int fd) {
account.version = RFIFOL(fd, 2); //for exe version check [Sirius]
account.userid = (char*)RFIFOP(fd,6);
account.userid[23] = '\0';
- remove_control_chars(account.userid);
+ remove_control_chars((unsigned char *)account.userid);
if (RFIFOW(fd,0) == 0x64) {
memcpy(account.passwd, RFIFOP(fd,30), 24);
account.passwd[24] = '\0';
@@ -2888,7 +2888,7 @@ int parse_login(int fd) {
memcpy(account.passwd, RFIFOP(fd,30), 32);
account.passwd[32] = '\0';
}
- remove_control_chars(account.passwd);
+ remove_control_chars((unsigned char *)account.passwd);
#ifdef PASSWORDENC
account.passwdenc = (RFIFOW(fd,0) == 0x64) ? 0 : PASSWORDENC;
#else
@@ -3030,14 +3030,14 @@ int parse_login(int fd) {
char* server_name;
account.userid = (char*)RFIFOP(fd,2);
account.userid[23] = '\0';
- remove_control_chars(account.userid);
+ remove_control_chars((unsigned char *)account.userid);
memcpy(account.passwd, RFIFOP(fd,26), 24);
account.passwd[24] = '\0';
- remove_control_chars(account.passwd);
+ remove_control_chars((unsigned char *)account.passwd);
account.passwdenc = 0;
server_name = (char*)RFIFOP(fd,60);
server_name[19] = '\0';
- remove_control_chars(server_name);
+ remove_control_chars((unsigned char *)server_name);
login_log("Connection request of the char-server '%s' @ %d.%d.%d.%d:%d (ip: %s)" RETCODE,
server_name, RFIFOB(fd,54), RFIFOB(fd,55), RFIFOB(fd,56), RFIFOB(fd,57), RFIFOW(fd,58), ip);
result = mmo_auth(&account, fd);
@@ -3125,7 +3125,7 @@ int parse_login(int fd) {
char* password="";
memcpy(password, RFIFOP(fd,4), 24);
password[24] = '\0';
- remove_control_chars(password);
+ remove_control_chars((unsigned char *)password);
// If remote administration is enabled and password sent by client matches password read from login server configuration file
if ((admin_state == 1) && (strcmp(password, admin_pass) == 0)) {
login_log("'ladmin'-login: Connection in administration mode accepted (non encrypted password: %s, ip: %s)" RETCODE, password, ip);
@@ -3294,8 +3294,8 @@ int login_lan_config_read(const char *lancfgName) {
if (sscanf(line,"%[^:]: %[^\r\n]", w1, w2) != 2)
continue;
- remove_control_chars(w1);
- remove_control_chars(w2);
+ remove_control_chars((unsigned char *)w1);
+ remove_control_chars((unsigned char *)w2);
if (strcmpi(w1, "lan_char_ip") == 0) { // Read Char-Server Lan IP Address
memset(lan_char_ip, 0, sizeof(lan_char_ip));
h = gethostbyname(w2);
@@ -3379,8 +3379,8 @@ int login_config_read(const char *cfgName) {
line[sizeof(line)-1] = '\0';
memset(w2, 0, sizeof(w2));
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2) {
- remove_control_chars(w1);
- remove_control_chars(w2);
+ remove_control_chars((unsigned char *)w1);
+ remove_control_chars((unsigned char *)w2);
if (strcmpi(w1, "admin_state") == 0) {
admin_state = config_switch(w2);