diff options
author | Haru <haru@dotalux.com> | 2015-12-26 02:28:59 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-05-08 19:53:57 +0200 |
commit | 2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (patch) | |
tree | 3656a91a896f0ef090606b2b4c9184ad73153a3f /src/char | |
parent | 58a7bf46508b7f186704e7efb39576e09f0ab866 (diff) | |
download | hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.gz hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.bz2 hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.xz hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.zip |
Fixed various issues pointed out by cppcheck
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 2 | ||||
-rw-r--r-- | src/char/geoip.c | 5 | ||||
-rw-r--r-- | src/char/inter.c | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/char/char.c b/src/char/char.c index 8f3d5b0c9..cf2f7d87c 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1890,7 +1890,7 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) { //When the weapon is sent and your option is riding, the client crashes on login!? // FIXME[Haru]: is OPTION_HANBOK intended to be part of this list? And if it is, should the list also include other OPTION_ costumes? - WBUFW(buf,56) = p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK) ? 0 : p->weapon; + WBUFW(buf,56) = (p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK)) ? 0 : p->weapon; WBUFW(buf,58) = p->base_level; WBUFW(buf,60) = min(p->skill_point, INT16_MAX); diff --git a/src/char/geoip.c b/src/char/geoip.c index 433ff0918..002045850 100644 --- a/src/char/geoip.c +++ b/src/char/geoip.c @@ -132,9 +132,8 @@ void geoip_final(bool shutdown) **/ void geoip_init(void) { - int i, fno; + int fno; char db_type = 1; - unsigned char delim[3]; struct stat bufa; FILE *db; @@ -165,6 +164,8 @@ void geoip_init(void) if (fseek(db, -3l, SEEK_END) != 0) { db_type = 0; } else { + int i; + unsigned char delim[3]; for (i = 0; i < GEOIP_STRUCTURE_INFO_MAX_SIZE; i++) { if (fread(delim, sizeof(delim[0]), 3, db) != 3) { db_type = 0; diff --git a/src/char/inter.c b/src/char/inter.c index 8f7f5c144..d277abec9 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -1085,7 +1085,6 @@ int mapif_parse_broadcast(int fd) int mapif_parse_WisRequest(int fd) { struct WisData* wd; - static int wisid = 0; char name[NAME_LENGTH]; char esc_name[NAME_LENGTH*2+1];// escaped name char* data; @@ -1125,6 +1124,7 @@ int mapif_parse_WisRequest(int fd) } else { + static int wisid = 0; CREATE(wd, struct WisData, 1); // Whether the failure of previous wisp/page transmission (timeout) |