Fix passing plain char into ctype.h is* functions

Change-Id: Ifa1098a12a9d3d28a4d272ac8f4ab72d9a92282b
This commit is contained in:
Stephan Bergmann 2017-03-22 21:55:48 +01:00
parent 971be75c58
commit cb643b44ca
2 changed files with 5 additions and 5 deletions

View File

@ -166,7 +166,7 @@ int control(int counter)
* We subtract 1 as we want the number of the next line.
*/
line = atoi(work) - 1; /* Reset line number */
for (tp = work; isdigit(*tp) || type[(int)*tp] == SPA; tp++)
for (tp = work; isdigit((unsigned char)*tp) || type[(int)*tp] == SPA; tp++)
; /* Skip over digits */
if (*tp != EOS) /* Got a filename, so: */
{

View File

@ -174,7 +174,7 @@ int dooptions(int argc, char** argv)
else
{
c = *ap++; /* Option byte */
if (islower(c)) /* Normalize case */
if (islower((unsigned char)c)) /* Normalize case */
c = toupper(c);
switch (c) /* Command character */
{
@ -224,13 +224,13 @@ int dooptions(int argc, char** argv)
}
while (sizp->bits != endtest && *ap != EOS)
{
if (!isdigit(*ap)) /* Skip to next digit */
if (!isdigit((unsigned char)*ap)) /* Skip to next digit */
{
ap++;
continue;
}
size = 0; /* Compile the value */
while (isdigit(*ap))
while (isdigit((unsigned char)*ap))
{
size *= 10;
size += (*ap++ - '0');
@ -254,7 +254,7 @@ int dooptions(int argc, char** argv)
#if OSL_DEBUG_LEVEL > 1
case 'X': /* Debug */
debug = (isdigit(*ap)) ? atoi(ap) : 1;
debug = (isdigit((unsigned char)*ap)) ? atoi(ap) : 1;
#if (HOST == SYS_UNIX)
signal(SIGINT, (void (*)(int)) abort); /* Trap "interrupt" */
#endif