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/char/pincode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/char/pincode.c') diff --git a/src/char/pincode.c b/src/char/pincode.c index 325a705a5..b8b30a1b8 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -126,10 +126,11 @@ void pincode_notifyLoginPinError(int account_id) { } void pincode_decrypt(unsigned int userSeed, char* pin) { - int i, pos; + int i; char tab[10] = {0,1,2,3,4,5,6,7,8,9}; - for( i = 1; i < 10; i++ ){ + for (i = 1; i < 10; i++) { + int pos; userSeed = pincode->baseSeed + userSeed * pincode->multiplier; pos = userSeed % (i + 1); if( i != pos ){ -- cgit v1.2.3-70-g09d2