summaryrefslogtreecommitdiff
path: root/src/map/buyingstore.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/map/buyingstore.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/buyingstore.c')
-rw-r--r--src/map/buyingstore.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 8efffa342..a53acdbb0 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -65,10 +65,9 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count)
{
unsigned int i, weight, listidx;
- struct item_data* id;
- if( !result || count == 0 )
- {// canceled, or no items
+ if (!result || count == 0) {
+ // canceled, or no items
return;
}
@@ -107,10 +106,11 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
weight = sd->weight;
// check item list
- for( i = 0; i < count; i++ )
- {// itemlist: <name id>.W <amount>.W <price>.L
+ for (i = 0; i < count; i++) {
+ // itemlist: <name id>.W <amount>.W <price>.L
unsigned short nameid, amount;
int price, idx;
+ struct item_data* id;
nameid = RBUFW(itemlist,i*8+0);
amount = RBUFW(itemlist,i*8+2);