~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the Deflate decoder correctly handle the special case of a
[sgt/halibut]
/
error.c
diff --git
a/error.c
b/error.c
index
b6c2007
..
00d007d
100644
(file)
--- a/
error.c
+++ b/
error.c
@@
-19,6
+19,7
@@
static void do_error(int code, va_list ap) {
int i, j;
char *sp, *sp2;
wchar_t *wsp, *wsp2;
int i, j;
char *sp, *sp2;
wchar_t *wsp, *wsp2;
+ unsigned wc;
filepos fpos, fpos2, *fposp;
int flags = 0;
filepos fpos, fpos2, *fposp;
int flags = 0;
@@
-374,6
+375,14
@@
static void do_error(int code, va_list ap) {
sprintf(error, "font has an invalid header");
flags = FILEPOS;
break;
sprintf(error, "font has an invalid header");
flags = FILEPOS;
break;
+ case err_sfntbadglyph:
+ fpos = *va_arg(ap, filepos *);
+ wc = va_arg(ap, unsigned);
+ sprintf(error,
+ "warning: character U+%04X references an non-existent glyph",
+ wc);
+ flags = FILEPOS;
+ break;
case err_whatever:
sp = va_arg(ap, char *);
vsprintf(error, sp, ap);
case err_whatever:
sp = va_arg(ap, char *);
vsprintf(error, sp, ap);
@@
-384,7
+393,7
@@
static void do_error(int code, va_list ap) {
if (flags & PREFIX)
fputs("halibut: ", stderr);
if (flags & FILEPOS) {
if (flags & PREFIX)
fputs("halibut: ", stderr);
if (flags & FILEPOS) {
- fprintf(stderr, "%s:", fpos.filename);
+ fprintf(stderr, "%s:", fpos.filename
? fpos.filename : "<standard input>"
);
if (fpos.line > 0)
fprintf(stderr, "%d:", fpos.line);
if (fpos.col > 0)
if (fpos.line > 0)
fprintf(stderr, "%d:", fpos.line);
if (fpos.col > 0)