diff options
author | Haru <haru@dotalux.com> | 2015-01-20 04:36:08 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-01-20 04:41:33 +0100 |
commit | 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch) | |
tree | dab9d12a6a4b95a37598e27e6e86d6047360d61b /src/char/pincode.c | |
parent | 03709c136ad300be631adfd38dc36c2433bda718 (diff) | |
download | hercules-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/char/pincode.c')
-rw-r--r-- | src/char/pincode.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 ){ |