diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-30 16:51:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-09 11:52:30 +0300 |
commit | fb9f8cadf5ebe6c6d2fce3106a917cbd8956695d (patch) | |
tree | 623b5de0f061cdf672e711ac111ceaff85cf3680 /src/char | |
parent | f4b719e8ac80797dabfae7cc1486aa3cf1dc1a80 (diff) | |
download | hercules-fb9f8cadf5ebe6c6d2fce3106a917cbd8956695d.tar.gz hercules-fb9f8cadf5ebe6c6d2fce3106a917cbd8956695d.tar.bz2 hercules-fb9f8cadf5ebe6c6d2fce3106a917cbd8956695d.tar.xz hercules-fb9f8cadf5ebe6c6d2fce3106a917cbd8956695d.zip |
Add checks to int_auction.c
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/int_auction.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 57eae641d..2c54db16b 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -17,6 +17,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" @@ -33,7 +34,7 @@ static int inter_auction_count(int char_id, bool buy) for( auction = dbi_first(iter); dbi_exists(iter); auction = dbi_next(iter) ) { - if( (buy && auction->buyer_id == char_id) || (!buy && auction->seller_id == char_id) ) + if ((buy && auction->buyer_id == char_id) || (!buy && auction->seller_id == char_id)) i++; } dbi_destroy(iter); @@ -160,6 +161,7 @@ static int inter_auction_end_timer(int tid, int64 tick, int id, intptr_t data) { void inter_auction_delete(struct auction_data *auction) { + nullpo_retv(auction); unsigned int auction_id = auction->auction_id; if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%d'", auction_db, auction_id) ) @@ -240,6 +242,8 @@ void mapif_auction_sendlist(int fd, int char_id, short count, short pages, unsig { int len = (sizeof(struct auction_data) * count) + 12; + nullpo_retv(buf); + WFIFOHEAD(fd, len); WFIFOW(fd,0) = 0x3850; WFIFOW(fd,2) = len; @@ -297,6 +301,8 @@ void mapif_auction_register(int fd, struct auction_data *auction) { int len = sizeof(struct auction_data) + 4; + nullpo_retv(auction); + WFIFOHEAD(fd,len); WFIFOW(fd,0) = 0x3851; WFIFOW(fd,2) = len; |