add '(uchar)' casts to ctype calls
This is from the pull request for the assertion failure fix. It did not mention how to reproduce the assertion failure, just added casts to a bunch of isspace/isprint/tolower calls that didn't already have such. I removed an obsolete change for win/tty/topl.c and changed the win/win32/mswproc.c code to avoid using an expression with side-effects (*colorstring++) in calls to tolower() in case someone overrides that with a macro which evaluates its argument more than once as some pre- ANSI ones used to do. Not tested, might have typos.... sys/wince/*.c still needs similar casts.
This commit is contained in:
@@ -299,7 +299,7 @@ int start;
|
||||
* whitespace, do not change the value of SAVEF.
|
||||
*/
|
||||
for (bp = buf; *bp; bp++)
|
||||
if (!isspace(*bp)) {
|
||||
if (!isspace((uchar) *bp)) {
|
||||
strncpy(SAVEF, bp, PATHLEN);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ int portdebug;
|
||||
if (vk == 0xBF)
|
||||
ch = M('?');
|
||||
else
|
||||
ch = M(tolower(keycode));
|
||||
ch = M(tolower((uchar) keycode));
|
||||
}
|
||||
if (ch == '\r')
|
||||
ch = '\n';
|
||||
|
||||
@@ -167,7 +167,7 @@ int portdebug;
|
||||
if (vk == 0xBF)
|
||||
ch = M('?');
|
||||
else
|
||||
ch = M(tolower(keycode));
|
||||
ch = M(tolower((uchar) keycode));
|
||||
}
|
||||
/* Attempt to work better with international keyboards. */
|
||||
else {
|
||||
|
||||
@@ -352,7 +352,7 @@ int portdebug;
|
||||
if (vk == 0xBF)
|
||||
ch = M('?');
|
||||
else
|
||||
ch = M(tolower(keycode));
|
||||
ch = M(tolower((uchar) keycode));
|
||||
} else if (ch < 32 && !isnumkeypad(scan)) {
|
||||
/* Control code; ReadConsole seems to filter some of these,
|
||||
* including ESC */
|
||||
|
||||
@@ -119,7 +119,7 @@ char *str;
|
||||
char *ptr;
|
||||
char drive;
|
||||
if ((ptr = index(str, ':')) != (char *) 0) {
|
||||
drive = toupper(*(ptr - 1));
|
||||
drive = toupper((uchar) *(ptr - 1));
|
||||
_chdrive((drive - 'A') + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user