diff options
Diffstat (limited to 'src/common/mapindex.c')
-rw-r--r-- | src/common/mapindex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 79125e010..035518f68 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -48,7 +48,7 @@ const char* mapindex_getmapname_ext(const char* string, char* output) { size_t len; - strcpy(buf,string); + safestrncpy(buf,string, sizeof(buf)); sscanf(string, "%*[^#]%*[#]%15s", buf); len = safestrnlen(buf, MAP_NAME_LENGTH); @@ -154,6 +154,7 @@ int mapindex_init(void) { switch (sscanf(line, "%12s\t%d", map_name, &index)) { case 1: //Map with no ID given, auto-assign index = last_index+1; + /* Fall through */ case 2: //Map with ID given mapindex->addmap(index,map_name); total++; |