summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-10-25 00:42:05 +0200
committerHaru <haru@dotalux.com>2014-10-25 00:42:05 +0200
commit3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5 (patch)
tree91414ec9aad216e7297a700dd9bec8c08d668502 /src/map/clif.c
parentab3b5bd8d231434d0c3fb4db0d977e96613b4e77 (diff)
downloadhercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.gz
hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.bz2
hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.tar.xz
hercules-3e1fe0d3842aab1c85f4dfd8e3533ca6631fc4e5.zip
Added some missing variable initializations
- The issue was caused by memcmp failing because of garbage in structs padding. - Fixes bugreport:8410, special thanks (and credits for the fix) to Garr http://hercules.ws/board/tracker/issue-8410-autotradeat-issue/ - Also reduced scope of some variables, where appropriate. - Thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 033a5e081..ae885465b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -15117,7 +15117,8 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
if (body_len > MAIL_BODY_LENGTH)
body_len = MAIL_BODY_LENGTH;
- if( !mail->setattachment(sd, &msg) ) { // Invalid Append condition
+ memset(&msg, 0, sizeof(msg));
+ if (!mail->setattachment(sd, &msg)) { // Invalid Append condition
clif->mail_send(sd->fd, true); // fail
mail->removeitem(sd,0);
mail->removezeny(sd,0);
@@ -15335,9 +15336,10 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
struct auction_data auction;
struct item_data *item;
- if( !battle_config.feature_auction )
+ if (!battle_config.feature_auction)
return;
+ memset(&auction, 0, sizeof(auction));
auction.price = RFIFOL(fd,2);
auction.buynow = RFIFOL(fd,6);
auction.hours = RFIFOW(fd,10);