1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-07 19:29:18 +00:00

Fix a problem where the linker tries to print a NULL pointer if there is a

problem with the builtin configuration that is used.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1083 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-10-25 18:51:49 +00:00
parent efce8fa8d0
commit 62314aeac9

View File

@ -92,7 +92,7 @@ void CfgWarning (const char* Format, ...)
xvsprintf (Buf, sizeof (Buf), Format, ap);
va_end (ap);
Warning ("%s(%u): %s", CfgName, CfgErrorLine, Buf);
Warning ("%s(%u): %s", CfgGetName(), CfgErrorLine, Buf);
}
@ -107,7 +107,7 @@ void CfgError (const char* Format, ...)
xvsprintf (Buf, sizeof (Buf), Format, ap);
va_end (ap);
Error ("%s(%u): %s", CfgName, CfgErrorLine, Buf);
Error ("%s(%u): %s", CfgGetName(), CfgErrorLine, Buf);
}
@ -475,7 +475,13 @@ void CfgSetName (const char* Name)
const char* CfgGetName (void)
/* Get the name of the config file */
{
return CfgName? CfgName : "";
if (CfgName) {
return CfgName;
} else if (CfgBuf) {
return "[builtin config]";
} else {
return "";
}
}