[PATCH:xscope 4/6] Use correct argument type for ctype(3) functions.

Thomas Klausner tk at giga.or.at
Tue Dec 7 07:59:16 UTC 2021


---
 scope.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scope.c b/scope.c
index 51e134d..6028eab 100644
--- a/scope.c
+++ b/scope.c
@@ -199,7 +199,7 @@ CMDStringToInt(char *s, int *v)
     else if (*s == '0') {
         sscanf(s, "%o", v);
     }
-    else if (isdigit(*s)) {
+    else if (isdigit(*(unsigned char *)s)) {
         sscanf(s, "%d", v);
     }
     else if (*s == '\'') {
@@ -251,7 +251,7 @@ CMDSplitIntoWords(char *line, char **argv)
 
     argc = 0;
     while (*line) {
-        while (isspace(*line))
+        while (isspace(*(unsigned char *)line))
             line++;
         if (!*line)
             break;
@@ -267,7 +267,7 @@ CMDSplitIntoWords(char *line, char **argv)
         else {
             *argv++ = line;
             argc++;
-            while (*line && !isspace(*line))
+            while (*line && !isspace(*(unsigned char *)line))
                 line++;
             if (*line)
                 *line++ = '\0';
@@ -1395,7 +1395,7 @@ DataFromRawFile(FD rawfd)
         in = FDinfo[rawfd].buffer;
 
         /* lines starting with space indicate change of sender */
-        if (isspace(*in)) {
+        if (isspace(*(unsigned char *)in)) {
             /* If we already have data in buffer, process it */
             if ((fd != -1) && (FDinfo[fd].bufcount > 0)) {
                 debug(16, (stderr, "reporting %d bytes from: %s %s\n",
@@ -1413,7 +1413,7 @@ DataFromRawFile(FD rawfd)
             }
             else {
                 /* Need to parse header to figure out which direction */
-                while (isspace(*in)) {
+                while (isspace(*(unsigned char *)in)) {
                     in++;
                 }
                 if (strncmp(in, "Client Connect (fd ", 19) == 0) {
@@ -1448,7 +1448,7 @@ DataFromRawFile(FD rawfd)
                         int clientid;
 
                         in = n + 8;
-                        if (isdigit(*in))
+                        if (isdigit(*(unsigned char *)in))
                             clientid = strtol(in, NULL, 10);
                         else
                             clientid = 1;
@@ -1500,7 +1500,7 @@ DataFromRawFile(FD rawfd)
                 n = strchr(in, ':');
                 if (n != NULL)
                     in = n + 1;
-                while (isspace(*in))
+                while (isspace(*(unsigned char *)in))
                     in++;
             }
         }
-- 
2.34.1



More information about the xorg-devel mailing list