summaryrefslogtreecommitdiff
path: root/src/map/mapreg_sql.c
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/map/mapreg_sql.c
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/map/mapreg_sql.c')
-rw-r--r--src/map/mapreg_sql.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 9bf67196e..46962ac14 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -97,7 +97,7 @@ bool mapreg_setreg(int64 uid, int val) {
if (name[1] != '@' && !mapreg->skip_insert) {// write new variable to database
char tmp_str[(SCRIPT_VARNAME_LENGTH+1)*2+1];
SQL->EscapeStringLen(map->mysql_handle, tmp_str, name, strnlen(name, SCRIPT_VARNAME_LENGTH+1));
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%d','%d')", mapreg->table, tmp_str, i, val) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%u','%d')", mapreg->table, tmp_str, i, val) )
Sql_ShowDebug(map->mysql_handle);
}
i64db_put(mapreg->regs.vars, uid, m);
@@ -111,7 +111,7 @@ bool mapreg_setreg(int64 uid, int val) {
i64db_remove(mapreg->regs.vars, uid);
if( name[1] != '@' ) {// Remove from database because it is unused.
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg->table, name, i) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%u'", mapreg->table, name, i) )
Sql_ShowDebug(map->mysql_handle);
}
}
@@ -136,7 +136,7 @@ bool mapreg_setregstr(int64 uid, const char* str) {
if( i )
script->array_update(&mapreg->regs, uid, true);
if(name[1] != '@') {
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg->table, name, i) )
+ if (SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%u'", mapreg->table, name, i))
Sql_ShowDebug(map->mysql_handle);
}
if( (m = i64db_get(mapreg->regs.vars, uid)) ) {
@@ -170,7 +170,7 @@ bool mapreg_setregstr(int64 uid, const char* str) {
char tmp_str2[255*2+1];
SQL->EscapeStringLen(map->mysql_handle, tmp_str, name, strnlen(name, SCRIPT_VARNAME_LENGTH+1));
SQL->EscapeStringLen(map->mysql_handle, tmp_str2, str, strnlen(str, 255));
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%d','%s')", mapreg->table, tmp_str, i, tmp_str2) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%u','%s')", mapreg->table, tmp_str, i, tmp_str2) )
Sql_ShowDebug(map->mysql_handle);
}
i64db_put(mapreg->regs.vars, uid, m);