1
0
Fork 0

Replace strncat with safe_strcat where possible

This commit is contained in:
krcroft 2019-12-07 17:54:24 -08:00 committed by Patryk Obara
parent c9198b2944
commit c34670aba0

View file

@ -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]) {