chiark / gitweb /
Quite a few instances of the Cardinal Error of Ctype were turned up
authorSimon Tatham <anakin@pobox.com>
Sun, 17 Jul 2005 17:10:11 +0000 (17:10 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 17 Jul 2005 17:10:11 +0000 (17:10 +0000)
by a grep I just did. Oops.

[originally from svn r6113]

cube.c
fifteen.c
flip.c
netslide.c
pattern.c
samegame.c
sixteen.c
twiddle.c
windows.c

diff --git a/cube.c b/cube.c
index c1462e79f67f759e357ae126a7465f471eeb8806..e271ce3ca8617ac99c9cf73d3c7f8382ba0ef91a 100644 (file)
--- a/cube.c
+++ b/cube.c
@@ -285,7 +285,7 @@ static void decode_params(game_params *ret, char const *string)
       default: break;
     }
     ret->d1 = ret->d2 = atoi(string);
-    while (*string && isdigit(*string)) string++;
+    while (*string && isdigit((unsigned char)*string)) string++;
     if (*string == 'x') {
         string++;
         ret->d2 = atoi(string);
index c076350a5bab20be5e35cec165b8e1d4fdb05d9e..20ceb4b39b8bea8b790088daeba2ccec0331f273 100644 (file)
--- a/fifteen.c
+++ b/fifteen.c
@@ -76,7 +76,7 @@ static game_params *dup_params(game_params *params)
 static void decode_params(game_params *ret, char const *string)
 {
     ret->w = ret->h = atoi(string);
-    while (*string && isdigit(*string)) string++;
+    while (*string && isdigit((unsigned char)*string)) string++;
     if (*string == 'x') {
         string++;
         ret->h = atoi(string);
diff --git a/flip.c b/flip.c
index 2ec16bae9b551c3bb5bb190c8d69a766d0a6ab5b..6ccd872c317b6835c9ece6d05b1fbb061811c6fe 100644 (file)
--- a/flip.c
+++ b/flip.c
@@ -116,11 +116,11 @@ static game_params *dup_params(game_params *params)
 static void decode_params(game_params *ret, char const *string)
 {
     ret->w = ret->h = atoi(string);
-    while (*string && isdigit(*string)) string++;
+    while (*string && isdigit((unsigned char)*string)) string++;
     if (*string == 'x') {
         string++;
         ret->h = atoi(string);
-        while (*string && isdigit(*string)) string++;
+        while (*string && isdigit((unsigned char)*string)) string++;
     }
     if (*string == 'r') {
         string++;
index 1962d92cdea44693777fa130d2fe62ac916dbef9..206535b7a7f176f21e0005a7b2029b4a94a35015 100644 (file)
@@ -213,16 +213,16 @@ static void decode_params(game_params *ret, char const *string)
     ret->movetarget = 0;
 
     ret->width = atoi(p);
-    while (*p && isdigit(*p)) p++;
+    while (*p && isdigit((unsigned char)*p)) p++;
     if (*p == 'x') {
         p++;
         ret->height = atoi(p);
-        while (*p && isdigit(*p)) p++;
+        while (*p && isdigit((unsigned char)*p)) p++;
         if ( (ret->wrapping = (*p == 'w')) != 0 )
             p++;
         if (*p == 'b') {
             ret->barrier_probability = atof(++p);
-            while (*p && (isdigit(*p) || *p == '.')) p++;
+            while (*p && (isdigit((unsigned char)*p) || *p == '.')) p++;
         }
         if (*p == 'm') {
             ret->movetarget = atoi(++p);
index 3f2d65e78883291593e1f19bef02d1b8c8aa28bc..3d5c11f7cc11616d2df8d867e3aeb439cbbc445b 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -106,11 +106,11 @@ static void decode_params(game_params *ret, char const *string)
     char const *p = string;
 
     ret->w = atoi(p);
-    while (*p && isdigit(*p)) p++;
+    while (*p && isdigit((unsigned char)*p)) p++;
     if (*p == 'x') {
         p++;
         ret->h = atoi(p);
-        while (*p && isdigit(*p)) p++;
+        while (*p && isdigit((unsigned char)*p)) p++;
     } else {
         ret->h = ret->w;
     }
index 810a8ebd426651edc15ef7f0c7d4cdae6043743f..4bb535d9c3dca3481488fe6874799aba447d7291 100644 (file)
@@ -291,9 +291,9 @@ static char *validate_desc(game_params *params, char *desc)
        char *q = p;
        int n;
 
-       if (!isdigit(*p))
+       if (!isdigit((unsigned char)*p))
            return "Not enough numbers in string";
-       while (isdigit(*p)) p++;
+       while (isdigit((unsigned char)*p)) p++;
 
        if (i < area-1 && *p != ',')
            return "Expected comma after number";
index 0e4f8a8cc66d306bbc586c7d624d24c1a0cc6273..457e9c9c4a7961ed44e6fa2872d1b49d21d21bc7 100644 (file)
--- a/sixteen.c
+++ b/sixteen.c
@@ -100,7 +100,7 @@ static void decode_params(game_params *ret, char const *string)
 {
     ret->w = ret->h = atoi(string);
     ret->movetarget = 0;
-    while (*string && isdigit(*string)) string++;
+    while (*string && isdigit((unsigned char)*string)) string++;
     if (*string == 'x') {
         string++;
         ret->h = atoi(string);
index 2f33fb7a1d09f7451158bc4eed2d92de1580d13d..1000ef4bef6c5dba39ee592fbf870cb1c96f63d1 100644 (file)
--- a/twiddle.c
+++ b/twiddle.c
@@ -108,16 +108,16 @@ static void decode_params(game_params *ret, char const *string)
     ret->n = 2;
     ret->rowsonly = ret->orientable = FALSE;
     ret->movetarget = 0;
-    while (*string && isdigit(*string)) string++;
+    while (*string && isdigit((unsigned char)*string)) string++;
     if (*string == 'x') {
         string++;
         ret->h = atoi(string);
-       while (*string && isdigit(*string)) string++;
+       while (*string && isdigit((unsigned char)*string)) string++;
     }
     if (*string == 'n') {
         string++;
         ret->n = atoi(string);
-       while (*string && isdigit(*string)) string++;
+       while (*string && isdigit((unsigned char)*string)) string++;
     }
     while (*string) {
        if (*string == 'r') {
@@ -127,7 +127,7 @@ static void decode_params(game_params *ret, char const *string)
        } else if (*string == 'm') {
             string++;
            ret->movetarget = atoi(string);
-            while (string[1] && isdigit(string[1])) string++;
+            while (string[1] && isdigit((unsigned char)string[1])) string++;
        }
        string++;
     }
index 57673e151d2e5bee4716fe7466b813424c567d18..08513d885999fd32a9786a91e31ec3889756a66a 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -1690,7 +1690,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
        RegisterClass(&wndclass);
     }
 
-    while (*cmdline && isspace(*cmdline))
+    while (*cmdline && isspace((unsigned char)*cmdline))
        cmdline++;
 
     if (!new_window(inst, *cmdline ? cmdline : NULL, &error)) {