From 12af580f39d7d835ba2a13c64291d4315b723a07 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Aug 2017 21:08:18 +0300 Subject: Fix implicit-fallthrough warnings in libconfig.c --- 3rdparty/libconfig/libconfig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/3rdparty/libconfig/libconfig.c b/3rdparty/libconfig/libconfig.c index 5b6eaac73..9077b0131 100644 --- a/3rdparty/libconfig/libconfig.c +++ b/3rdparty/libconfig/libconfig.c @@ -860,6 +860,7 @@ static int __config_setting_get_int(const struct config_setting_t *setting, } else { /* fall through */ } + return(CONFIG_FALSE); default: return(CONFIG_FALSE); @@ -898,6 +899,7 @@ static int __config_setting_get_int64(const struct config_setting_t *setting, } else { /* fall through */ } + return(CONFIG_FALSE); default: return(CONFIG_FALSE); @@ -965,6 +967,7 @@ static int __config_setting_get_float(const struct config_setting_t *setting, } else { /* fall through */ } + return(CONFIG_FALSE); default: return(CONFIG_FALSE); -- cgit v1.2.3-70-g09d2 From 625e300318f14d3ac16c1a569a955bd85f9297ff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Aug 2017 21:15:16 +0300 Subject: Fix possible overflow in npc_parsename. --- src/map/npc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/npc.c b/src/map/npc.c index 38996a0a3..6beff2b77 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2617,7 +2617,7 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con do { ++i; - snprintf(newname, ARRAYLENGTH(newname), "%d_%d_%d_%d", i, nd->bl.m, nd->bl.x, nd->bl.y); + safesnprintf(newname, ARRAYLENGTH(newname), "%d_%d_%d_%d", i, nd->bl.m, nd->bl.x, nd->bl.y); } while( npc->name2id(newname) != NULL ); strcpy(this_mapname, (nd->bl.m == -1 ? "(not on a map)" : mapindex_id2name(map_id2index(nd->bl.m)))); -- cgit v1.2.3-70-g09d2