summaryrefslogtreecommitdiff
path: root/src/login/account_sql.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-12-10 19:48:55 +0100
committerHaru <haru@dotalux.com>2013-12-17 01:11:33 +0100
commit15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48 (patch)
treec5dd5b25003f8c21381c7a2e1f010dba71e40b90 /src/login/account_sql.c
parenta23d072a66d2569ba13921522be3c82ae9aad576 (diff)
downloadhercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.gz
hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.bz2
hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.xz
hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.zip
Fixed several compiler warnings
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/login/account_sql.c')
-rw-r--r--src/login/account_sql.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/login/account_sql.c b/src/login/account_sql.c
index 533b3d860..283eb3a0d 100644
--- a/src/login/account_sql.c
+++ b/src/login/account_sql.c
@@ -543,16 +543,16 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
SQL->GetData(sql_handle, 3, &data, NULL); acc->sex = data[0];
SQL->GetData(sql_handle, 4, &data, NULL); safestrncpy(acc->email, data, sizeof(acc->email));
SQL->GetData(sql_handle, 5, &data, NULL); acc->group_id = atoi(data);
- SQL->GetData(sql_handle, 6, &data, NULL); acc->state = strtoul(data, NULL, 10);
+ SQL->GetData(sql_handle, 6, &data, NULL); acc->state = (unsigned int)strtoul(data, NULL, 10);
SQL->GetData(sql_handle, 7, &data, NULL); acc->unban_time = atol(data);
SQL->GetData(sql_handle, 8, &data, NULL); acc->expiration_time = atol(data);
- SQL->GetData(sql_handle, 9, &data, NULL); acc->logincount = strtoul(data, NULL, 10);
+ SQL->GetData(sql_handle, 9, &data, NULL); acc->logincount = (unsigned int)strtoul(data, NULL, 10);
SQL->GetData(sql_handle, 10, &data, NULL); safestrncpy(acc->lastlogin, data, sizeof(acc->lastlogin));
SQL->GetData(sql_handle, 11, &data, NULL); safestrncpy(acc->last_ip, data, sizeof(acc->last_ip));
SQL->GetData(sql_handle, 12, &data, NULL); safestrncpy(acc->birthdate, data, sizeof(acc->birthdate));
SQL->GetData(sql_handle, 13, &data, NULL); acc->char_slots = (uint8)atoi(data);
SQL->GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode));
- SQL->GetData(sql_handle, 15, &data, NULL); acc->pincode_change = atol(data);
+ SQL->GetData(sql_handle, 15, &data, NULL); acc->pincode_change = (unsigned int)atol(data);
SQL->FreeResult(sql_handle);
@@ -568,7 +568,6 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
while( SQL_SUCCESS == SQL->NextRow(sql_handle) )
{
- char* data;
SQL->GetData(sql_handle, 0, &data, NULL); safestrncpy(acc->account_reg2[i].str, data, sizeof(acc->account_reg2[i].str));
SQL->GetData(sql_handle, 1, &data, NULL); safestrncpy(acc->account_reg2[i].value, data, sizeof(acc->account_reg2[i].value));
++i;