diff options
author | Haru <haru@dotalux.com> | 2013-11-29 00:51:32 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-11-29 00:51:32 +0100 |
commit | 0cf52e88ea2779d00c64e36b33e606d658682136 (patch) | |
tree | de2fa623d10dc9d647e21af764f820a0537060ef /src/char/char.c | |
parent | 3fae6a6a8f25406aab8cd568e40141c57f2110ce (diff) | |
download | hercules-0cf52e88ea2779d00c64e36b33e606d658682136.tar.gz hercules-0cf52e88ea2779d00c64e36b33e606d658682136.tar.bz2 hercules-0cf52e88ea2779d00c64e36b33e606d658682136.tar.xz hercules-0cf52e88ea2779d00c64e36b33e606d658682136.zip |
Corrected an uninitialized variable when adding an item
- The .favorite field of newly added inventory items wasn't correctly
initialized to zero, potentially causing data loss (fixes
bugreport:7854, thanks to Vincent, GrumpyPanda).
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index 63b47cfcf..e58fc9eef 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1278,6 +1278,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything StrBuf->Printf(&buf, ", `card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", cart_db, MAX_CART); + memset(&tmp_item, 0, sizeof(tmp_item)); if( SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf)) || SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &char_id, 0) || SQL_ERROR == SQL->StmtExecute(stmt) |