From: handa Date: Mon, 23 May 2005 02:21:07 +0000 (+0000) Subject: (OTF_check_features): Fix indexing to X-Git-Tag: REL-0-9-5~65 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=25e97ca0ad6ddd502960a0741bef1623f005020f;p=m17n%2Flibotf.git (OTF_check_features): Fix indexing to feature_list->Feature. (OTF_tag): Handle the case that the length of NAME is short. --- diff --git a/src/otfopen.c b/src/otfopen.c index 5727198..22dddca 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -2968,7 +2968,11 @@ OTF_tag (char *name) if (! name) return (OTF_Tag) 0; - return (OTF_Tag) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); + return (OTF_Tag) ((p[0] << 24) + | (! p[1] ? 0 + : ((p[1] << 16) + | (! p[2] ? 0 + : (p[2] << 8) | p[3])))); } void