summaryrefslogtreecommitdiff
path: root/src/cff/cffload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cff/cffload.c')
-rw-r--r--src/cff/cffload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index eee701d60..76e8fd4a2 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -835,7 +835,6 @@
{
FT_Error error = FT_Err_Ok;
FT_UInt i;
- FT_Long j;
FT_UShort max_cid = 0;
@@ -853,9 +852,10 @@
/* When multiple GIDs map to the same CID, we choose the lowest */
/* GID. This is not described in any spec, but it matches the */
- /* behaviour of recent Acroread versions. */
- for ( j = (FT_Long)num_glyphs - 1; j >= 0; j-- )
- charset->cids[charset->sids[j]] = (FT_UShort)j;
+ /* behaviour of recent Acroread versions. The loop stops when */
+ /* the unsigned index wraps around after reaching zero. */
+ for ( i = num_glyphs - 1; i < num_glyphs; i-- )
+ charset->cids[charset->sids[i]] = (FT_UShort)i;
charset->max_cid = max_cid;
charset->num_glyphs = num_glyphs;