summaryrefslogtreecommitdiff
path: root/src/map/log.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-19 21:40:53 +0100
committerHaru <haru@dotalux.com>2016-03-20 18:32:07 +0100
commit127093b5327de343f4ae3f7c8752c465eea911c8 (patch)
treeaad51f53ba9bb8b99aa55a902ab1353a1937b403 /src/map/log.c
parentf4fced20c769ccee7f808531221dda481f7bbcca (diff)
downloadhercules-127093b5327de343f4ae3f7c8752c465eea911c8.tar.gz
hercules-127093b5327de343f4ae3f7c8752c465eea911c8.tar.bz2
hercules-127093b5327de343f4ae3f7c8752c465eea911c8.tar.xz
hercules-127093b5327de343f4ae3f7c8752c465eea911c8.zip
Changed buffer argument of SQL->StmtBindParam() to const
Parameters are supposed to be read-only Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/log.c')
-rw-r--r--src/map/log.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/log.c b/src/map/log.c
index 245229a15..c19190d90 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -289,7 +289,7 @@ void log_atcommand_sub_sql(struct map_session_data* sd, const char* message)
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_gm, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, 255))
|| SQL_SUCCESS != SQL->StmtExecute(stmt) )
{
SqlStmt_ShowDebug(stmt);
@@ -331,11 +331,11 @@ void log_npc_sub_sql(struct map_session_data *sd, const char *message)
nullpo_retv(sd);
nullpo_retv(message);
stmt = SQL->StmtMalloc(logs->mysql_handle);
- if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
- || SQL_SUCCESS != SQL->StmtExecute(stmt) )
- {
+ if (SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SQL->StmtExecute(stmt)
+ ) {
SqlStmt_ShowDebug(stmt);
SQL->StmtFree(stmt);
return;
@@ -388,8 +388,8 @@ void log_chat_sub_sql(e_log_chat_type type, int type_id, int src_charid, int src
nullpo_retv(message);
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", logs->config.log_chat, logs->chattype2char(type), type_id, src_charid, src_accid, mapname, x, y)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, CHAT_SIZE_MAX))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, CHAT_SIZE_MAX))
|| SQL_SUCCESS != SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);