diff options
author | Haru <haru@dotalux.com> | 2015-05-19 02:33:27 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-05-19 03:07:38 +0200 |
commit | 0c1ce8e1c427d665c207512a0e858872ef80672d (patch) | |
tree | 9e5a29d39875fe0cf74d93400b2a815fa92c3733 /src/map/npc.c | |
parent | 46c6e66222cc3aaf1b1ea08794a6b818d7065b67 (diff) | |
download | hercules-0c1ce8e1c427d665c207512a0e858872ef80672d.tar.gz hercules-0c1ce8e1c427d665c207512a0e858872ef80672d.tar.bz2 hercules-0c1ce8e1c427d665c207512a0e858872ef80672d.tar.xz hercules-0c1ce8e1c427d665c207512a0e858872ef80672d.zip |
Fixed some issues reported by coverity scan [1/3]
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 1721e3db3..c66f6533b 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3815,13 +3815,14 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char } else if (!strcmpi(w3,"battleground")) { struct map_zone_data *zone; - if( state ) { - if( sscanf(w4, "%d", &state) == 1 ) + if (state) { + if (w4 && sscanf(w4, "%d", &state) == 1) map->list[m].flag.battleground = state; else map->list[m].flag.battleground = 1; // Default value - } else + } else { map->list[m].flag.battleground = 0; + } if( map->list[m].flag.battleground && map->list[m].flag.pvp ) { map->list[m].flag.pvp = 0; |