Commit 3037b069f8574be3841c9f9d9ca5701e2dce881d

Werner Lemberg 2004-06-26T07:03:53

* src/type1/t1afm.c (afm_atoindex): Fix boundary test. Reported by Dirck Blaskey.

diff --git a/ChangeLog b/ChangeLog
index 7d50f0c..e7ccf7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-25  Werner Lemberg  <wl@gnu.org>
+
+	* src/type1/t1afm.c (afm_atoindex): Fix boundary test.  Reported
+	by Dirck Blaskey.
+
 2004-06-24  David Turner  <david@freetype.org>
 
         * src/truetype/ttgload.c, src/truetype/ttxgvar.c: removing
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index 9945ebd..65d86fa 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -63,13 +63,13 @@
 
 
     /* skip whitespace */
-    while ( ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' ) &&
-            p < limit                                             )
+    while ( p < limit                                             &&
+            ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' ) )
       p++;
     *start = p;
 
     /* now, read glyph name */
-    while ( IS_ALPHANUM( *p ) && p < limit )
+    while ( p < limit && IS_ALPHANUM( *p ) )
       p++;
 
     len = p - *start;