(OTF_check_features): Fix indexing to
authorhanda <handa>
Mon, 23 May 2005 02:21:07 +0000 (02:21 +0000)
committerhanda <handa>
Mon, 23 May 2005 02:21:07 +0000 (02:21 +0000)
feature_list->Feature.
(OTF_tag): Handle the case that the length of NAME is short.

src/otfopen.c

index 5727198..22dddca 100644 (file)
@@ -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