diff options
Diffstat (limited to 'src/char/int_auction.c')
-rw-r--r-- | src/char/int_auction.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 57eae641d..8d51777fb 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -6,22 +6,23 @@ #include "int_auction.h" +#include "char/char.h" +#include "char/int_mail.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#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" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "int_mail.h" -#include "inter.h" -#include "mapif.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" struct inter_auction_interface inter_auction_s; @@ -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,7 +161,10 @@ static int inter_auction_end_timer(int tid, int64 tick, int id, intptr_t data) { void inter_auction_delete(struct auction_data *auction) { - unsigned int auction_id = auction->auction_id; + unsigned int auction_id; + nullpo_retv(auction); + + auction_id = auction->auction_id; if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%d'", auction_db, auction_id) ) Sql_ShowDebug(inter->sql_handle); @@ -240,6 +244,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 +303,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; |