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/devnag | |
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/devnag')
-rw-r--r-- | Build/source/texk/devnag/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/devnag/src/devnag.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Build/source/texk/devnag/ChangeLog b/Build/source/texk/devnag/ChangeLog index c8a9594973b..16f605965d9 100644 --- a/Build/source/texk/devnag/ChangeLog +++ b/Build/source/texk/devnag/ChangeLog @@ -1,3 +1,7 @@ +2014-06-19 Peter Breitenlohner <peb@mppmu.mpg.de> + + * src/devnag.c: Avoid 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/devnag/src/devnag.c b/Build/source/texk/devnag/src/devnag.c index 71ee0993d0b..af163c83ff3 100644 --- a/Build/source/texk/devnag/src/devnag.c +++ b/Build/source/texk/devnag/src/devnag.c @@ -1172,7 +1172,7 @@ char *getsubarg(void) { while (subcom[i] != '{') i++; i++; while (subcom[i] == ' ') i++; - while (isalpha(subcom[i])) com[j++]= subcom[i++]; + while (isalpha((unsigned char)subcom[i])) com[j++]= subcom[i++]; com[j] = 0; i = 0; result = (char*) malloc (strlen(com)+1); @@ -1737,7 +1737,7 @@ void dnproc(void) { /* ------------------ End Addition ----------------- */ - if (!isalpha(symbol)) sendchar(symbol); + if (!isalpha((unsigned char)symbol)) sendchar(symbol); else { nbchcomm = 0; /* Marc Csernel */ do { @@ -1745,7 +1745,7 @@ void dnproc(void) { sendchar(symbol); symbol = inp_ch(); } - while (isalpha(symbol)); + while (isalpha((unsigned char)symbol)); /* --------- Addition by Marc Csernel 1998 --------- */ @@ -2242,7 +2242,7 @@ void sendchar(char c) { int i = strlen(word); word[i] = c == end_of_line ? '\n' : c; word[i+1] = '\0'; - if (isspace(c)) put_word(); + if (isspace((unsigned char)c)) put_word(); } /* @@ -2464,7 +2464,7 @@ char find_dn(void) { again = FALSE; dn_ptr = strstr(svbuf, "{\\dn"); if (dn_ptr != NULL) { - again = isalpha(dn_ptr[4]); + again = isalpha((unsigned char)dn_ptr[4]); svbuf = dn_ptr+4; } } |