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/geoip.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/geoip.c')
-rw-r--r-- | src/char/geoip.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/char/geoip.c b/src/char/geoip.c index e5b77af1f..1268019e1 100644 --- a/src/char/geoip.c +++ b/src/char/geoip.c @@ -56,14 +56,13 @@ const char* geoip_getcountry(uint32 ipnum) { int depth; unsigned int x; - const unsigned char *buf; unsigned int offset = 0; if( geoip->data->active == false ) return geoip_countryname[0]; for (depth = 31; depth >= 0; depth--) { - buf = geoip->data->cache + (long)6 *offset; + const unsigned char *buf = geoip->data->cache + (long)6 *offset; if (ipnum & (1 << depth)) { /* Take the right-hand branch */ x = (buf[3*1 + 0] << (0*8)) |