pdftex[912]

commits+thanh at tug.org commits+thanh at tug.org
Fri Oct 27 17:40:08 CEST 2023


Revision: 912
          https://tug.org/svn/pdftex?view=revision&revision=912
Author:   thanh
Date:     2023-10-27 17:40:08 +0200 (Fri, 27 Oct 2023)
Log Message:
-----------
bugfix: wrong ToUnicode entries on Big Endian arch

Modified Paths:
--------------
    branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c

Modified: branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c	2023-10-27 15:39:07 UTC (rev 911)
+++ branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c	2023-10-27 15:40:08 UTC (rev 912)
@@ -66,6 +66,7 @@
     int i, l;
     glyph_unicode_entry *gu, t;
     void **aa;
+    unsigned long sscan_result;
 
     p = makecstring(glyph);
     assert(strlen(p) < SMALL_BUF_SIZE);
@@ -115,13 +116,15 @@
         gu->code = UNI_STRING;
         gu->unicode_seq = xstrdup(buf2);
     } else {
-        i = sscanf(p, "%lX", &(gu->code));
+        i = sscanf(p, "%lX", &sscan_result);
         assert(i == 1);
-        if (gu->code < 0 || gu->code > 0x10FFFF) {
+        if (sscan_result > 0x10FFFF) {
             pdftex_warn("ToUnicode: value out of range [0,10FFFF]: %lX",
-                        gu->code);
+                        sscan_result);
             gu->code = UNI_UNDEF;
         }
+        else
+            gu->code = sscan_result;
     }
     aa = avl_probe(glyph_unicode_tree, gu);
     assert(aa != NULL);



More information about the pdftex-commits mailing list.