diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-12-13 12:16:40 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-12-13 12:16:40 +0000 |
commit | 2e859a485b65e4ae3bc61c2c8e26d5dbe050dbd2 (patch) | |
tree | c27e7573344d4be727288559275d645266bfd1bb | |
parent | 95a71c26578970d4baed10b779333e659f12fd0c (diff) |
dvipsk: better fix of a bug reported by Norbert Klingen
git-svn-id: svn://tug.org/texlive/trunk@42695 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 3 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/emspecial.c | 17 |
2 files changed, 2 insertions, 18 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 8299e31e761..e10cfc3c791 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,7 +1,6 @@ 2016-12-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp> - * emspecial.c: Initialize emstr[500] in emspecial(), to fix wrong - strlen (emstr). Reported by Norbert Klingen: + * emspecial.c: Fix a bug in emspecial(), reported by Norbert Klingen: http://tug.org/pipermail/tex-live/2016-December/039483.html. 2016-11-08 Karl Berry <karl@freefriends.org> diff --git a/Build/source/texk/dvipsk/emspecial.c b/Build/source/texk/dvipsk/emspecial.c index 462bce60fce..c96437620af 100644 --- a/Build/source/texk/dvipsk/emspecial.c +++ b/Build/source/texk/dvipsk/emspecial.c @@ -145,21 +145,6 @@ char emunit[30]; char emstr[500]; char *emp; -/* Initialize emstr[500] because emstr in the code below may not - be a right string, leading to wrong strlen(emstr): - - if (strlen(emstr) - 2 >= sizeof(emstr)) { - fprintf(stderr, "em:graph: special too long, truncating\n"); - break; - } - emstr[i++] = *emp; - } -*/ - { - int k; - for (k = 0; k < 500; k++) - emstr[k] = '\0'; - } hvpos(); for (emp = p+3; *emp && isspace((unsigned char)*emp); emp++); /* skip blanks */ if (strncmp(emp, "linewidth", 9) == 0) { @@ -291,7 +276,7 @@ char *emp; int i; for (emp = emp+5; *emp && isspace((unsigned char)*emp); emp++); /* skip blanks */ for (i=0; *emp && !isspace((unsigned char)*emp) && !(*emp==','); emp++) { - if (strlen (emstr) > 498) { + if (i > 498) { fprintf(stderr, "em:graph: special too long, truncating\n"); break; } |