From c34670aba0a5d9aeeb2ac426198d81f9ad035673 Mon Sep 17 00:00:00 2001 From: krcroft Date: Sat, 7 Dec 2019 17:54:24 -0800 Subject: [PATCH] Replace strncat with safe_strcat where possible --- src/dos/drive_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 04ca79a5..9dbe1215 100644 --- a/src/dos/drive_cache.cpp +++ b/src/dos/drive_cache.cpp @@ -204,7 +204,7 @@ char* DOS_Drive_Cache::GetExpandName(const char* path) { // Last Entry = File safe_strcpy(dir, pos+1); (void) GetLongName(dirInfo, dir, sizeof(dir)); // ignore the return code - strncat(work, dir, sizeof(work) - strlen(work) - 1); + safe_strcat(work, dir); } if (*work) { @@ -790,7 +790,7 @@ bool DOS_Drive_Cache::OpenDir(CFileInfo* dir, const char* expand, Bit16u& id) { // Add "/" char end[2]={CROSS_FILESPLIT,0}; if (expandcopy[strlen(expandcopy)-1] != CROSS_FILESPLIT) { - strncat(expandcopy, end, sizeof(expandcopy) - strlen(expandcopy) - 1); + safe_strcat(expandcopy, end); } // open dir if (dirSearch[id]) {