If transistor instance is at top level, there will be no colon

in the model name.
This commit is contained in:
Holger Vogt 2026-02-13 16:56:00 +01:00
parent c093f985e1
commit 53aa1f991e
1 changed files with 7 additions and 6 deletions

View File

@ -378,13 +378,14 @@ void cm_degmon(ARGS) /* structure holding parms,
*/
char *ipath = strdup(INSTMODNAME);
char *colon = strchr(ipath, ':');
if (!colon) {
cm_message_printf("Error: no colon, incompatible model name %s\n", ipath);
cm_cexit(1);
}
*colon = '\0';
char *xinstname = PARAM(instname);
snprintf(inam, 1024, "n.%s.%s.n%s", ipath, xinstname, devmod);
if (colon) {
*colon = '\0';
snprintf(inam, 1024, "n.%s.%s.n%s", ipath, xinstname, devmod);
}
else /* top level instance only */
snprintf(inam, 1024, "n.%s.n%s", xinstname, devmod);
loc->parentname = strdup(inam);
tfree(ipath);