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/login/account_sql.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/login/account_sql.c')
-rw-r--r-- | src/login/account_sql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login/account_sql.c b/src/login/account_sql.c index adbb7914d..f745d3d13 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -666,12 +666,12 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) { AccountDB_SQL* db = (AccountDB_SQL*)self; int count = RFIFOW(fd, 12); - if( count ) { + if (count) { int cursor = 14, i; char key[32], sval[254]; - unsigned int index; - for(i = 0; i < count; i++) { + for (i = 0; i < count; i++) { + unsigned int index; safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor)); cursor += RFIFOB(fd, cursor) + 1; |