diff options
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/mapfile.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/tounicode.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/writet1.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/writettf.c | 2 |
5 files changed, 14 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index ac596ca5337..29489fa6d2f 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,8 @@ +2014-06-19 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mapfile.c, tounicode.c, writet1.c, writettf: Avoid undefined + behaviour when char is signed. + 2014-06-18 Peter Breitenlohner <peb@mppmu.mpg.de> * ttf2afm.c: Avoid undefined behaviour when char is signed. diff --git a/Build/source/texk/web2c/pdftexdir/mapfile.c b/Build/source/texk/web2c/pdftexdir/mapfile.c index 3efe7a71e90..c0e91bf839b 100644 --- a/Build/source/texk/web2c/pdftexdir/mapfile.c +++ b/Build/source/texk/web2c/pdftexdir/mapfile.c @@ -428,15 +428,15 @@ static void fm_scan_line(void) fm = new_fm_entry(); read_field(r, q, buf); set_field(tfm_name); - if (!isdigit(*r)) { /* 2nd field ps_name may not start with a digit */ + if (!isdigit((unsigned char)*r)) { /* 2nd field ps_name may not start with a digit */ read_field(r, q, buf); set_field(ps_name); } - if (isdigit(*r)) { /* font descriptor /Flags given? */ - for (s = r; isdigit(*s); s++); + if (isdigit((unsigned char)*r)) { /* font descriptor /Flags given? */ + for (s = r; isdigit((unsigned char)*s); s++); if (*s == ' ' || *s == '"' || *s == '<' || *s == '\0') { /* not e. g. 8r.enc */ fm->fd_flags = atoi(r); - while (isdigit(*r)) + while (isdigit((unsigned char)*r)) r++; } } diff --git a/Build/source/texk/web2c/pdftexdir/tounicode.c b/Build/source/texk/web2c/pdftexdir/tounicode.c index 31121d864e1..a246366bf03 100644 --- a/Build/source/texk/web2c/pdftexdir/tounicode.c +++ b/Build/source/texk/web2c/pdftexdir/tounicode.c @@ -80,7 +80,7 @@ void deftounicode(strnumber glyph, strnumber unistr) for (i = 0; i < l; i++) { if (p[i] == ' ') valid_unistr = 2; /* if a space occurs we treat this entry as a string */ - else if (!isXdigit(p[i])) { + else if (!isXdigit((unsigned char)p[i])) { valid_unistr = 0; break; } @@ -137,7 +137,7 @@ static long check_unicode_value(const char *s, boolean multiple_value) return UNI_UNDEF; for (i = 0; i < l; i++) { - if (!isXdigit(s[i])) + if (!isXdigit((unsigned char)s[i])) return UNI_UNDEF; if (multiple_value) { if (i % 4 == 3) { diff --git a/Build/source/texk/web2c/pdftexdir/writet1.c b/Build/source/texk/web2c/pdftexdir/writet1.c index 0e39aaa209c..363853bf38a 100644 --- a/Build/source/texk/web2c/pdftexdir/writet1.c +++ b/Build/source/texk/web2c/pdftexdir/writet1.c @@ -379,7 +379,7 @@ static float t1_scan_num(char *p, char **r) pdftex_fail("a number expected: `%s'", t1_line_array); } if (r != NULL) { - for (; isdigit(*p) || *p == '.' || + for (; isdigit((unsigned char)*p) || *p == '.' || *p == 'e' || *p == 'E' || *p == '+' || *p == '-'; p++); *r = p; } @@ -1493,7 +1493,7 @@ static void t1_flush_cs(boolean is_subr) t1_line_ptr = t1_line_array; for (p = start_line; p - start_line < size_pos;) *t1_line_ptr++ = *p++; - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) p++; sprintf(t1_line_ptr, "%u", count); strcat(t1_line_ptr, p); diff --git a/Build/source/texk/web2c/pdftexdir/writettf.c b/Build/source/texk/web2c/pdftexdir/writettf.c index 0ec53a9a210..ab68813a3c9 100644 --- a/Build/source/texk/web2c/pdftexdir/writettf.c +++ b/Build/source/texk/web2c/pdftexdir/writettf.c @@ -328,7 +328,7 @@ static char *strip_spaces_and_delims(char *s, int l) for (i = 0; i < l; s++, i++) { if (*s == '(' || *s == ')' || *s == '<' || *s == '>' || *s == '[' || *s == ']' || *s == '{' || *s == '}' || - *s == '/' || *s == '%' || isspace(*s)) + *s == '/' || *s == '%' || isspace((unsigned char)*s)) continue; *p++ = *s; } |