diff options
author | Haru <haru@dotalux.com> | 2014-08-07 03:39:13 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-08-07 05:37:38 +0200 |
commit | c45e3fa9793a273a0eab40d1626bcda7d710552c (patch) | |
tree | 4f6c9d47770a15c8cbfe065f7ee9203f77e57022 /src/char/int_storage.c | |
parent | caf89724767465ecf339c391bb6d7a937d563fb2 (diff) | |
download | hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.gz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.bz2 hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.xz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.zip |
Corrected several format-string errors through the code
- Functions that expect a printf-style format string are now marked as
such, so that gcc/clang will emit a warning warn you if you mismatch
format string and arguments.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_storage.c')
-rw-r--r-- | src/char/int_storage.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c index bf7b76da0..882d9b2a5 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -220,16 +220,13 @@ int mapif_parse_SaveGuildStorage(int fd) guild_id = RFIFOL(fd,8); len = RFIFOW(fd,2); - if( sizeof(struct guild_storage) != len - 12 ) - { - ShowError("inter storage: data size error %d != %d\n", sizeof(struct guild_storage), len - 12); - } - else - { - if( SQL_ERROR == SQL->Query(sql_handle, "SELECT `guild_id` FROM `%s` WHERE `guild_id`='%d'", guild_db, guild_id) ) + if (sizeof(struct guild_storage) != len - 12) { + ShowError("inter storage: data size mismatch: %d != %"PRIuS"\n", len - 12, sizeof(struct guild_storage)); + } else { + if (SQL_ERROR == SQL->Query(sql_handle, "SELECT `guild_id` FROM `%s` WHERE `guild_id`='%d'", guild_db, guild_id)) { Sql_ShowDebug(sql_handle); - else if( SQL->NumRows(sql_handle) > 0 ) - {// guild exists + } else if(SQL->NumRows(sql_handle) > 0) { + // guild exists SQL->FreeResult(sql_handle); guild_storage_tosql(guild_id, (struct guild_storage*)RFIFOP(fd,12)); mapif_save_guild_storage_ack(fd, RFIFOL(fd,4), guild_id, 0); @@ -397,7 +394,7 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd) if( j ) StrBuf->AppendStr(&buf, ","); - StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'", + StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%"PRIu64"'", guild_id, items[j].nameid, items[j].amount, items[j].equip, items[j].identify, items[j].refine, items[j].attribute, items[j].expire_time, items[j].bound, items[j].unique_id); for( s = 0; s < MAX_SLOTS; ++s ) |