From: handa Date: Mon, 2 Mar 2009 01:48:56 +0000 (+0000) Subject: (read_name): Avoid casting the arg to OTF_MALLOC. X-Git-Tag: REL-0-9-9~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2508c62135933a8da479f787ae04488655c3be90;p=m17n%2Flibotf.git (read_name): Avoid casting the arg to OTF_MALLOC. --- 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);