X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/e997256c0986b92663c1c5f6e5d5d8a4e8a6eadf..26c8c119efd44804c7b27f8637c69eda63f0c189:/error.c diff --git a/error.c b/error.c index 2a2c6cd..00d007d 100644 --- a/error.c +++ b/error.c @@ -18,7 +18,8 @@ static void do_error(int code, va_list ap) { char c; int i, j; char *sp, *sp2; - wchar_t *wsp, *wsp2, wc; + wchar_t *wsp, *wsp2; + unsigned wc; filepos fpos, fpos2, *fposp; int flags = 0; @@ -376,7 +377,7 @@ static void do_error(int code, va_list ap) { break; case err_sfntbadglyph: fpos = *va_arg(ap, filepos *); - wc = va_arg(ap, wchar_t); + wc = va_arg(ap, unsigned); sprintf(error, "warning: character U+%04X references an non-existent glyph", wc); @@ -392,7 +393,7 @@ static void do_error(int code, va_list ap) { if (flags & PREFIX) fputs("halibut: ", stderr); if (flags & FILEPOS) { - fprintf(stderr, "%s:", fpos.filename); + fprintf(stderr, "%s:", fpos.filename ? fpos.filename : ""); if (fpos.line > 0) fprintf(stderr, "%d:", fpos.line); if (fpos.col > 0)