summaryrefslogtreecommitdiff
path: root/src/char/int_quest.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-31 12:13:01 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-09 11:52:34 +0300
commit9b5bb84f693a19ff119af01fc0d4953e59ac583e (patch)
tree08a2033b8f7bff0c61ceac998fbb85995b65b205 /src/char/int_quest.c
parent097e767aec64b8de52ea9e52d7b12ee89191d678 (diff)
downloadhercules-9b5bb84f693a19ff119af01fc0d4953e59ac583e.tar.gz
hercules-9b5bb84f693a19ff119af01fc0d4953e59ac583e.tar.bz2
hercules-9b5bb84f693a19ff119af01fc0d4953e59ac583e.tar.xz
hercules-9b5bb84f693a19ff119af01fc0d4953e59ac583e.zip
Add checks to int_quest.c
Diffstat (limited to 'src/char/int_quest.c')
-rw-r--r--src/char/int_quest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index dd3d4e1bf..1d64f48a3 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -16,6 +16,7 @@
#include "../common/db.h"
#include "../common/malloc.h"
#include "../common/mmo.h"
+#include "../common/nullpo.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
#include "../common/sql.h"
@@ -66,8 +67,9 @@ struct quest *mapif_quests_fromsql(int char_id, int *count)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL)
- )
+ ) {
sqlerror = SQL_ERROR;
+ }
StrBuf->Destroy(&buf);
@@ -244,6 +246,7 @@ int mapif_parse_quest_save(int fd)
void mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int num_quests)
{
+ nullpo_retv(tmp_questlog);
WFIFOHEAD(fd,num_quests*sizeof(struct quest)+8);
WFIFOW(fd,0) = 0x3860;
WFIFOW(fd,2) = num_quests*sizeof(struct quest)+8;