From 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Jan 2015 04:36:08 +0100 Subject: 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 --- src/map/trade.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/map/trade.c') diff --git a/src/map/trade.c b/src/map/trade.c index 46acb4e16..379756394 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -239,7 +239,6 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd) struct item inventory2[MAX_INVENTORY]; struct item_data *data; int trade_i, i, n; - short amount; // check zenys value against hackers (Zeny was already checked on time of adding, but you never know when you lost some zeny since then. if(sd->deal.zeny > sd->status.zeny || (tsd->status.zeny > MAX_ZENY - sd->deal.zeny)) @@ -252,8 +251,8 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd) memcpy(&inventory2, &tsd->status.inventory, sizeof(struct item) * MAX_INVENTORY); // check free slot in both inventory - for(trade_i = 0; trade_i < 10; trade_i++) { - amount = sd->deal.item[trade_i].amount; + for (trade_i = 0; trade_i < 10; trade_i++) { + short amount = sd->deal.item[trade_i].amount; if (amount) { n = sd->deal.item[trade_i].index; if (amount > inventory[n].amount) -- cgit v1.2.3-60-g2f50