From 2508c62135933a8da479f787ae04488655c3be90 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 2 Mar 2009 01:48:56 +0000 Subject: [PATCH] (read_name): Avoid casting the arg to OTF_MALLOC. --- src/otfopen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/otfopen.c b/src/otfopen.c index fe9da87..b936921 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -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); -- 1.7.10.4