X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fotfopen.c;h=2101da83d9cef86c4d1558a7e408122a50066204;hb=92a7ec9828c859c1ef4cf384657836e9bbc8e2cd;hp=fe9da87f4585367678b767e610830e005827b4b5;hpb=8d74a15d4ca06a5ddc1208e26cf48357d7b82376;p=m17n%2Flibotf.git diff --git a/src/otfopen.c b/src/otfopen.c index fe9da87..2101da8 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -1,6 +1,6 @@ /* otfopen.c -- OpenType font reader. -Copyright (C) 2003, 2004, 2005, 2006, 2008 +Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO167 @@ -392,13 +392,14 @@ read_head_table (OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag) static int read_name (OTF *otf, OTF_Stream *stream, OTF_NameRecord *rec) { - char *errfmt = "nameID (%d)"; + char errfmt[256]; int errret = -1; OTF_StreamState state; int ucs = 0; int ascii = 0; int i; + sprintf (errfmt, "nameID (%d)%%s", rec->nameID); if (rec->platformID == 0) ucs = (rec->encodingID <= 3) ? 2 : 4; else if (rec->platformID == 1 && rec->encodingID == 0) @@ -408,7 +409,7 @@ read_name (OTF *otf, OTF_Stream *stream, OTF_NameRecord *rec) : rec->encodingID == 10 ? 4 : 0); - OTF_MALLOC (rec->name, rec->length + 1, (void *) rec->nameID); + OTF_MALLOC (rec->name, rec->length + 1, ""); SAVE_STREAM (stream, state); SEEK_STREAM (stream, stream->pos + rec->offset); READ_BYTES (stream, rec->name, rec->length);