1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

SCP: Cleanup gcc compiler flagged potential issues

Compiler warnings about undeclared case fall throughs, and potential
buffer overruns,
This commit is contained in:
Mark Pizzolato
2019-01-21 16:43:17 -08:00
parent 3cca0cf90b
commit cb9876ce65
5 changed files with 17 additions and 10 deletions

View File

@@ -3464,15 +3464,16 @@ if ((sDynamic) &&
else
ParentName[i/2] = Pdata[i] ? Pdata[i] : Pdata[i+1];
free (Pdata);
memset (CheckPath, 0, sizeof (CheckPath));
if (0 == memcmp (sDynamic->ParentLocatorEntries[j].PlatformCode, "W2ku", 4))
strncpy (CheckPath, ParentName, sizeof (CheckPath)-1);
strlcpy (CheckPath, ParentName, sizeof (CheckPath));
else
if (0 == memcmp (sDynamic->ParentLocatorEntries[j].PlatformCode, "W2ru", 4)) {
const char *c;
if ((c = strrchr (szVHDPath, '\\'))) {
memcpy (CheckPath, szVHDPath, c-szVHDPath+1);
strncpy (CheckPath+strlen(CheckPath), ParentName, sizeof (CheckPath)-(strlen (CheckPath)+1));
strlcat (CheckPath, ParentName, sizeof (CheckPath));
}
}
VhdPathToHostPath (CheckPath, CheckPath, sizeof (CheckPath));