From 6a5636ddf61e4fca9d258c11ebead182564f234f Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 12 Jan 2015 20:11:21 +0100 Subject: Fixed some -Wformat-security warnings Signed-off-by: Haru --- src/char/int_mail.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/char/int_mail.c') diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 2c0a85f33..0e5043e14 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -45,7 +45,7 @@ static int inter_mail_fromsql(int char_id, struct mail_data* md) StrBuf->Printf(&buf, " FROM `%s` WHERE `dest_id`='%d' AND `status` < 3 ORDER BY `id` LIMIT %d", mail_db, char_id, MAIL_MAX_INBOX + 1); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); @@ -160,16 +160,13 @@ static bool inter_mail_loadmessage(int mail_id, struct mail_message* msg) StrBuf->Printf(&buf, ",`card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `id` = '%d'", mail_db, mail_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) - || SQL_SUCCESS != SQL->NextRow(inter->sql_handle) ) - { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) + || SQL_SUCCESS != SQL->NextRow(inter->sql_handle)) { Sql_ShowDebug(inter->sql_handle); SQL->FreeResult(inter->sql_handle); StrBuf->Destroy(&buf); return false; - } - else - { + } else { char* data; SQL->GetData(inter->sql_handle, 0, &data, NULL); msg->id = atoi(data); @@ -253,8 +250,7 @@ static bool inter_mail_DeleteAttach(int mail_id) StrBuf->Printf(&buf, ", `card%d` = '0'", i); StrBuf->Printf(&buf, " WHERE `id` = '%d'", mail_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) - { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) { Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); -- cgit v1.2.3-70-g09d2