diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-06-19 11:14:35 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-06-19 11:14:35 +0000 |
commit | e5b8a1a0369901d3d73384cf553619d9351679aa (patch) | |
tree | a0b0d02bb0421b6f6f1dce118d40dfe6e91147b6 /Build/source/texk/seetexk | |
parent | a7803f3483864a647563ebda46f5fa39a92bb205 (diff) |
texk/*/, utils/*/: Avoid undefined behaviour when char is signed
git-svn-id: svn://tug.org/texlive/trunk@34310 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/seetexk')
-rw-r--r-- | Build/source/texk/seetexk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/seetexk/dvitodvi.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Build/source/texk/seetexk/ChangeLog b/Build/source/texk/seetexk/ChangeLog index b0ba9981aaf..6fe58a4f598 100644 --- a/Build/source/texk/seetexk/ChangeLog +++ b/Build/source/texk/seetexk/ChangeLog @@ -1,3 +1,7 @@ +2014-06-19 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvitodvi.c: Avboid undefined behaviour when char is signed. + 2014-06-16 Peter Breitenlohner <peb@mppmu.mpg.de> * Makefile.am: Drop the obsolete ACLOCAL_AMFLAGS. diff --git a/Build/source/texk/seetexk/dvitodvi.c b/Build/source/texk/seetexk/dvitodvi.c index ed76d6ae887..36bfaeac919 100644 --- a/Build/source/texk/seetexk/dvitodvi.c +++ b/Build/source/texk/seetexk/dvitodvi.c @@ -212,7 +212,7 @@ parseint(char **sp) neg = 1; s++; } - for (; isdigit(*s); s++) + for (; isdigit((unsigned char)*s); s++) n = n*10 + (*s-'0'); if (*sp == s) specusage(); *sp = s; @@ -231,12 +231,12 @@ parsedimen(char **sp) neg = 1; *sp = ++s; } - for (; isdigit(*s); s++) + for (; isdigit((unsigned char)*s); s++) whole = whole*10 + (*s-'0'); if (*s == '.') { *sp = ++s; - for (; isdigit(*s); s++) { + for (; isdigit((unsigned char)*s); s++) { if (den < 10000) { /* limit precision for scale to work */ num = num*10 + (*s-'0'); den *= 10; @@ -311,7 +311,7 @@ ParseSpecs(char *str, int make) else head = tail = &spare; while (*str) { - if (isdigit(*str)) { + if (isdigit((unsigned char)*str)) { num = parseint(&str); } else { switch (*str++) { |