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/inter.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/inter.c')
-rw-r--r-- | src/char/inter.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 6cd34dc39..5af9a6aab 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -764,7 +764,6 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type) *------------------------------------------*/ static int inter_config_read(const char* cfgName) { - int i; char line[1024], w1[1024], w2[1024]; FILE* fp; @@ -775,7 +774,7 @@ static int inter_config_read(const char* cfgName) } while (fgets(line, sizeof(line), fp)) { - i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2); + int i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2); if(i != 2) continue; @@ -1149,13 +1148,13 @@ int mapif_parse_Registry(int fd) if( count ) { int cursor = 14, i; char key[32], sval[254]; - unsigned int index; bool isLoginActive = session_isActive(chr->login_fd); if( isLoginActive ) chr->global_accreg_to_login_start(account_id,char_id); for(i = 0; i < count; i++) { + unsigned int index; safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor)); cursor += RFIFOB(fd, cursor) + 1; |