浏览代码

Follow up 022d72891e1c38ac6953a5118eea87efd7deddc3
* Fixed warnings in mapif_parse_itembound_retrieve

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>

Cydh Ramdh 10 年之前
父节点
当前提交
8e71ae6688
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/char/int_storage.c

+ 3 - 3
src/char/int_storage.c

@@ -282,9 +282,8 @@ int mapif_parse_itembound_retrieve(int fd)
 {
 {
 	StringBuf buf;
 	StringBuf buf;
 	SqlStmt* stmt;
 	SqlStmt* stmt;
-	bool found = false;
-	unsigned short i = 0, count = 0, size = 0;
-	struct item item, items[MAX_INVENTORY] = { 0 };
+	unsigned short i = 0, count = 0;
+	struct item item, items[MAX_INVENTORY];
 	int j, guild_id = RFIFOW(fd,10);
 	int j, guild_id = RFIFOW(fd,10);
 	uint32 char_id = RFIFOL(fd,2), account_id = RFIFOL(fd,6);
 	uint32 char_id = RFIFOL(fd,2), account_id = RFIFOL(fd,6);
 
 
@@ -319,6 +318,7 @@ int mapif_parse_itembound_retrieve(int fd)
 	for( j = 0; j < MAX_SLOTS; ++j )
 	for( j = 0; j < MAX_SLOTS; ++j )
 		SqlStmt_BindColumn(stmt, 9+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
 		SqlStmt_BindColumn(stmt, 9+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
 
 
+	memset(&items, 0, sizeof(items));
 	while( SQL_SUCCESS == SqlStmt_NextRow(stmt) )
 	while( SQL_SUCCESS == SqlStmt_NextRow(stmt) )
 		memcpy(&items[count++], &item, sizeof(struct item));
 		memcpy(&items[count++], &item, sizeof(struct item));
 	Sql_FreeResult(sql_handle);
 	Sql_FreeResult(sql_handle);