diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2012-05-18 01:57:00 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2012-05-18 01:57:00 +0000 |
commit | 573e644fd5eac8cd075e77535f7e978bf1554990 (patch) | |
tree | 2e97082e29e5e3b902d337a396a65e8a53289370 /Build/source/texk/web2c/luatexdir/tex/texmath.w | |
parent | ff3def13189580da6fe5254355c8f3b8091bb0fb (diff) |
Backport math related changes from luatex 0.71
git-svn-id: svn://tug.org/texlive/trunk@26479 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/texmath.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/texmath.w | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 1628ed5f99e..2adf03c5cec 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -1150,6 +1150,7 @@ void scan_extdef_del_code(int level, int extcode) @ @c mathcodeval scan_mathchar(int extcode) { + char errstr[255] = { 0 }; const char *hlp[] = { "I'm going to use 0 instead of that illegal code value.", NULL @@ -1163,6 +1164,11 @@ mathcodeval scan_mathchar(int extcode) tex_error("Invalid math code", hlp); cur_val = 0; } + if (cur_val < 0) { + snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); + tex_error(errstr, hlp); + cur_val = 0; + } mcls = (cur_val / 0x1000); mfam = ((cur_val % 0x1000) / 0x100); mchr = (cur_val % 0x100); @@ -1173,6 +1179,11 @@ mathcodeval scan_mathchar(int extcode) tex_error("Invalid math code", hlp); cur_val = 0; } + if (cur_val < 0) { + snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); + tex_error(errstr, hlp); + cur_val = 0; + } mcls = (cur_val / 0x1000000); mfam = ((cur_val % 0x1000000) / 0x10000); mchr = (cur_val % 0x10000); |