summaryrefslogtreecommitdiff
path: root/Build/source/texk/makeindexk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-19 11:14:35 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-19 11:14:35 +0000
commite5b8a1a0369901d3d73384cf553619d9351679aa (patch)
treea0b0d02bb0421b6f6f1dce118d40dfe6e91147b6 /Build/source/texk/makeindexk
parenta7803f3483864a647563ebda46f5fa39a92bb205 (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/makeindexk')
-rw-r--r--Build/source/texk/makeindexk/ChangeLog5
-rw-r--r--Build/source/texk/makeindexk/genind.c4
-rw-r--r--Build/source/texk/makeindexk/scanid.c10
3 files changed, 12 insertions, 7 deletions
diff --git a/Build/source/texk/makeindexk/ChangeLog b/Build/source/texk/makeindexk/ChangeLog
index 7fd091ce39e..aa41ff9f11d 100644
--- a/Build/source/texk/makeindexk/ChangeLog
+++ b/Build/source/texk/makeindexk/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * genind.c, scanid.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/makeindexk/genind.c b/Build/source/texk/makeindexk/genind.c
index 61cbaa9480b..1d1ba03ad51 100644
--- a/Build/source/texk/makeindexk/genind.c
+++ b/Build/source/texk/makeindexk/genind.c
@@ -441,8 +441,8 @@ insert_page(void)
while (pageno[i++] != NUL);
j = --i;
/* find the leftmost digit */
- while (isdigit(pageno[--i]) && i > 0);
- if (!isdigit(pageno[i]))
+ while (isdigit((unsigned char)pageno[--i]) && i > 0);
+ if (!isdigit((unsigned char)pageno[i]))
i++;
/* convert page from literal to numeric */
page = strtoint(&pageno[i]) + 1;
diff --git a/Build/source/texk/makeindexk/scanid.c b/Build/source/texk/makeindexk/scanid.c
index ccb1bbd4342..8076a6be472 100644
--- a/Build/source/texk/makeindexk/scanid.c
+++ b/Build/source/texk/makeindexk/scanid.c
@@ -419,7 +419,7 @@ scan_no(char no[], int npg[], short *count, short *type)
{
int i = 1;
- if (isdigit(no[0])) {
+ if (isdigit((unsigned char)no[0])) {
*type = ARAB;
if (!scan_arabic(no, npg, count))
return (FALSE);
@@ -457,7 +457,7 @@ scan_arabic(char no[], int npg[], short *count)
char str[ARABIC_MAX+1]; /* space for trailing NUL */
while ((no[i] != NUL) && (i <= ARABIC_MAX) && (!IS_COMPOSITOR)) {
- if (isdigit(no[i])) {
+ if (isdigit((unsigned char)no[i])) {
str[i] = no[i];
i++;
} else {
@@ -728,15 +728,15 @@ search_quote(char **sort_key, char **actual_key)
{ /* skip to umlaut or sharp S */
case 'a':
case 'A':
- sort = isupper(*(ptr + 1)) ? "Ae" : "ae";
+ sort = isupper((unsigned char)*(ptr + 1)) ? "Ae" : "ae";
break;
case 'o':
case 'O':
- sort = isupper(*(ptr + 1)) ? "Oe" : "oe";
+ sort = isupper((unsigned char)*(ptr + 1)) ? "Oe" : "oe";
break;
case 'u':
case 'U':
- sort = isupper(*(ptr + 1)) ? "Ue" : "ue";
+ sort = isupper((unsigned char)*(ptr + 1)) ? "Ue" : "ue";
break;
case 's':
sort = "ss";