summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 53058e6a8c5..04e933d45a4 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,7 @@
+2017-03-12 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.c: Adopt Jonathan's solution for the Change on 2017-02-01.
+
2017-02-13 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* texmfmp.c: unsigned long long >= 0. Thanks Luigi.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 152a2312e5a..c8b1dcc1b25 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -2818,9 +2818,10 @@ gettexstring (strnumber s)
unsigned bytesToWrite = 0;
poolpointer len, i, j;
string name;
- if (strstart[s + 1 - 65536L] < strstart[s - 65536L])
- return NULL;
- len = strstart[s + 1 - 65536L] - strstart[s - 65536L];
+ if (s >= 65536L)
+ len = strstart[s + 1 - 65536L] - strstart[s - 65536L];
+ else
+ len = 0;
name = xmalloc(len * 3 + 1); /* max UTF16->UTF8 expansion
(code units, not bytes) */
for (i = 0, j = 0; i < len; i++) {