From 2000a698da35915afb1a598433337a735d27ae24 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 30 Sep 2016 18:21:14 +0300 Subject: Add different fixes for gcc 7 warnings. Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings. --- src/map/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index f8754660c..a1efbb3b8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2291,7 +2291,7 @@ void read_constdb(void) struct config_setting_t *t; int i = 0; - sprintf(filepath, "%s/constants.conf", map->db_path); + snprintf(filepath, 256, "%s/constants.conf", map->db_path); if (!libconfig->load_file(&constants_conf, filepath)) return; @@ -9269,7 +9269,7 @@ BUILDIN(bonus) { val1 = skill->name2id(script_getstr(st, 3)); break; } - // else fall through + FALLTHROUGH default: val1 = script_getnum(st,3); break; -- cgit v1.2.3-70-g09d2