mirror of
https://github.com/cc65/cc65.git
synced 2024-07-17 09:29:10 +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:
parent
efce8fa8d0
commit
62314aeac9
@ -92,7 +92,7 @@ void CfgWarning (const char* Format, ...)
|
|||||||
xvsprintf (Buf, sizeof (Buf), Format, ap);
|
xvsprintf (Buf, sizeof (Buf), Format, ap);
|
||||||
va_end (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);
|
xvsprintf (Buf, sizeof (Buf), Format, ap);
|
||||||
va_end (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)
|
const char* CfgGetName (void)
|
||||||
/* Get the name of the config file */
|
/* Get the name of the config file */
|
||||||
{
|
{
|
||||||
return CfgName? CfgName : "";
|
if (CfgName) {
|
||||||
|
return CfgName;
|
||||||
|
} else if (CfgBuf) {
|
||||||
|
return "[builtin config]";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user