One correction to the last commit, otherwise segfaults are

essentially guaranteed. . .
This commit is contained in:
Tim Edwards 2021-05-23 21:26:02 -04:00
parent 82fada3af6
commit 8d8fe2fe55
1 changed files with 5 additions and 5 deletions

View File

@ -4261,6 +4261,11 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
cellnameptr++;
fullpathname = (char *)mallocMagic(strlen(cmd->tx_argv[1]) + 2);
strcpy(fullpathname, cmd->tx_argv[1]);
/* If the name still has ".mag" attached, then strip it. */
clen = strlen(fullpathname);
if ((clen > 4) && !strcmp(fullpathname + clen - 4, ".mag"))
*(fullpathname + clen - 4) = '\0';
}
else
{
@ -4273,11 +4278,6 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
if ((clen > 4) && !strcmp(cellnameptr + clen - 4, ".mag"))
*(cellnameptr + clen - 4) = '\0';
/* Same for fullpathname */
clen = strlen(fullpathname);
if ((clen > 4) && !strcmp(fullpathname + clen - 4, ".mag"))
*(fullpathname + clen - 4) = '\0';
/* Check for illegal characters in the cellname */
if (CmdIllegalChars(cellnameptr, "", "Cell name"))
{