summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-18 20:23:46 +0100
committerGitHub <noreply@github.com>2017-11-18 20:23:46 +0100
commit66ee4dea37d47af769cc94c8b8ebd2b12699ce7c (patch)
treeb524690b23670f041e8824d2eecec69f6dc80389 /src/map
parent901df02711777462bd9e4016c91b8166441d9353 (diff)
parente5a63561bba9d09e5a88636f4982cdb2cf57a569 (diff)
downloadhercules-66ee4dea37d47af769cc94c8b8ebd2b12699ce7c.tar.gz
hercules-66ee4dea37d47af769cc94c8b8ebd2b12699ce7c.tar.bz2
hercules-66ee4dea37d47af769cc94c8b8ebd2b12699ce7c.tar.xz
hercules-66ee4dea37d47af769cc94c8b8ebd2b12699ce7c.zip
Merge pull request #1901 from MishimaHaruna/sql-bind-types
Correct and sanitize SQL bind types
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mapreg_sql.c6
-rw-r--r--src/map/npc.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 4cdb91b21..02015e011 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -211,9 +211,9 @@ void script_load_mapreg(void) {
mapreg->skip_insert = true;
- SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &varname[0], sizeof(varname), &length, NULL);
- SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &index, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &value[0], sizeof(value), NULL, NULL);
+ SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &varname, sizeof varname, &length, NULL);
+ SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &index, sizeof index, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &value, sizeof value, NULL, NULL);
while ( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) {
int s = script->add_str(varname);
diff --git a/src/map/npc.c b/src/map/npc.c
index 0702b2525..10ff4ebf2 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1560,9 +1560,9 @@ void npc_market_fromsql(void)
return;
}
- SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &name[0], sizeof(name), NULL, NULL);
- SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &itemid, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &amount, 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &name, sizeof name, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &itemid, sizeof itemid, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &amount, sizeof amount, NULL, NULL);
while ( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) {
struct npc_data *nd = NULL;