summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFlorian Wilkemeyer <fw@f-ws.de>2015-12-15 16:41:34 +0100
committerHaru <haru@dotalux.com>2015-12-15 20:26:15 +0100
commit8a6f7e1f79146f6989bc921152f2fc539d44aa0f (patch)
treece110a745dbae75886a6d08a5a6e916031f732ae /src/map/script.c
parentb6efa351c0a55a2f45ef8724c066f26e1c67a90f (diff)
downloadhercules-8a6f7e1f79146f6989bc921152f2fc539d44aa0f.tar.gz
hercules-8a6f7e1f79146f6989bc921152f2fc539d44aa0f.tar.bz2
hercules-8a6f7e1f79146f6989bc921152f2fc539d44aa0f.tar.xz
hercules-8a6f7e1f79146f6989bc921152f2fc539d44aa0f.zip
Fixed some too long char buffer initializers.
- While they don't really cause an overflow (in C), there's no point in initializing strings to "\0". - Original commit message was: Found some static-assignment overflows -> fixed. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b73918c64..27313c401 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11747,9 +11747,9 @@ BUILDIN(setmapflag) {
case MF_NOWARPTO: map->list[m].flag.nowarpto = 1; break;
case MF_NIGHTMAREDROP: map->list[m].flag.pvp_nightmaredrop = 1; break;
case MF_ZONE:
- if( val2 ) {
- char zone[6] = "zone\0";
- char empty[1] = "\0";
+ if (val2 != NULL) {
+ const char *zone = "zone";
+ const char *empty = "";
char params[MAP_ZONE_MAPFLAG_LENGTH];
memcpy(params, val2, MAP_ZONE_MAPFLAG_LENGTH);
npc->parse_mapflag(map->list[m].name, empty, zone, params, empty, empty, empty, NULL);