diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -25,8 +25,13 @@ err_sprintf(buf, fmt, args) char *buf, *fmt; va_list args; { - sprintf(buf, "%s:%d: ", sourcefile, sourceline); - vsprintf((char*)buf+strlen(buf), fmt, args); + if (!sourcefile) { + vsprintf(buf, fmt, args); + } + else { + sprintf(buf, "%s:%d: ", sourcefile, sourceline); + vsprintf((char*)buf+strlen(buf), fmt, args); + } if (buf[strlen(buf)-1] != '\n') strcat(buf, "\n"); } |