summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-19 18:24:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-19 18:24:22 +0300
commit8dc7572164d1f630fed49e695d4bf62ea8e09a15 (patch)
tree66138d10ef1fd4f6d14666a5a078641e4c9f1b77 /src/login
parentc2c1322b230dc0f564397ac68615640f1083ee56 (diff)
downloadhercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.gz
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.bz2
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.tar.xz
hercules-8dc7572164d1f630fed49e695d4bf62ea8e09a15.zip
Fix all known warnings from compiler flags -Wformat*
Add all missing -Wformat flags into configure.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/account_sql.c2
-rw-r--r--src/login/ipban_sql.c2
-rw-r--r--src/login/login.c10
-rw-r--r--src/login/loginlog_sql.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/login/account_sql.c b/src/login/account_sql.c
index 1de0fb5e9..cb6fdba99 100644
--- a/src/login/account_sql.c
+++ b/src/login/account_sql.c
@@ -728,7 +728,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
switch (RFIFOB(fd, cursor++)) {
/* int */
case 0:
- if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%d')", db->global_acc_reg_num_db, account_id, key, index, RFIFOL(fd, cursor)) )
+ if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%u')", db->global_acc_reg_num_db, account_id, key, index, RFIFOL(fd, cursor)) )
Sql_ShowDebug(sql_handle);
cursor += 4;
break;
diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c
index 9d059ccd2..301d22c18 100644
--- a/src/login/ipban_sql.c
+++ b/src/login/ipban_sql.c
@@ -259,7 +259,7 @@ void ipban_log(uint32 ip)
if (failures >= login->config->dynamic_pass_failure_ban_limit)
{
uint8* p = (uint8*)&ip;
- if (SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s`(`list`,`btime`,`rtime`,`reason`) VALUES ('%u.%u.%u.*', NOW() , NOW() + INTERVAL %d MINUTE ,'Password error ban')",
+ if (SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s`(`list`,`btime`,`rtime`,`reason`) VALUES ('%u.%u.%u.*', NOW() , NOW() + INTERVAL %u MINUTE ,'Password error ban')",
ipban_table, p[3], p[2], p[1], login->config->dynamic_pass_failure_ban_duration))
{
Sql_ShowDebug(sql_handle);
diff --git a/src/login/login.c b/src/login/login.c
index 71cdded02..d724cccfb 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -494,12 +494,12 @@ void login_fromchar_parse_account_update(int fd, int id, const char *const ip)
RFIFOSKIP(fd,10);
if( !accounts->load_num(accounts, &acc, account_id) )
- ShowNotice("Char-server '%s': Error of Status change (account: %d not found, suggested status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Error of Status change (account: %d not found, suggested status %u, ip: %s).\n", server[id].name, account_id, state, ip);
else
if( acc.state == state )
- ShowNotice("Char-server '%s': Error of Status change - actual status is already the good status (account: %d, status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Error of Status change - actual status is already the good status (account: %d, status %u, ip: %s).\n", server[id].name, account_id, state, ip);
else {
- ShowNotice("Char-server '%s': Status change (account: %d, new status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Status change (account: %d, new status %u, ip: %s).\n", server[id].name, account_id, state, ip);
acc.state = state;
// Save
@@ -683,7 +683,7 @@ void login_fromchar_parse_request_account_reg2(int fd)
void login_fromchar_parse_update_wan_ip(int fd, int id)
{
server[id].ip = ntohl(RFIFOL(fd,2));
- ShowInfo("Updated IP of Server #%d to %d.%d.%d.%d.\n",id, CONVIP(server[id].ip));
+ ShowInfo("Updated IP of Server #%d to %u.%u.%u.%u.\n",id, CONVIP(server[id].ip));
RFIFOSKIP(fd,6);
}
@@ -1118,7 +1118,7 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
}
if( acc.state != 0 ) {
- ShowNotice("Connection refused (account: %s, pass: %s, state: %d, ip: %s)\n", sd->userid, sd->passwd, acc.state, ip);
+ ShowNotice("Connection refused (account: %s, pass: %s, state: %u, ip: %s)\n", sd->userid, sd->passwd, acc.state, ip);
return acc.state - 1;
}
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
index f26d9890f..356bba3b4 100644
--- a/src/login/loginlog_sql.c
+++ b/src/login/loginlog_sql.c
@@ -59,7 +59,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
if( !enabled )
return 0;
- if( SQL_ERROR == SQL->Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
+ if( SQL_ERROR == SQL->Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %u MINUTE",
log_login_db, sockt->ip2str(ip,NULL), minutes) )// how many times failed account? in one ip.
Sql_ShowDebug(sql_handle);