From e5b8a1a0369901d3d73384cf553619d9351679aa Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 19 Jun 2014 11:14:35 +0000 Subject: texk/*/, utils/*/: Avoid undefined behaviour when char is signed git-svn-id: svn://tug.org/texlive/trunk@34310 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/seetexk/ChangeLog | 4 ++++ Build/source/texk/seetexk/dvitodvi.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'Build/source/texk/seetexk') 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 + + * dvitodvi.c: Avboid undefined behaviour when char is signed. + 2014-06-16 Peter Breitenlohner * 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++) { -- cgit v1.2.3