OSDN Git Service

Some minor changes from Stefan Allius to make conf and
authorEric Andersen <andersen@codepoet.org>
Fri, 8 Nov 2002 02:28:40 +0000 (02:28 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 8 Nov 2002 02:28:40 +0000 (02:28 -0000)
mconf compile under Solaris.

extra/config/conf.c
extra/config/confdata.c
extra/config/mconf.c
extra/config/symbol.c

index 910d52c..6bc5de9 100644 (file)
@@ -78,7 +78,7 @@ static void strip(char *str)
        char *p = str;
        int l;
 
-       while ((isspace(*p)))
+       while ((isspace((int)*p)))
                p++;
        l = strlen(p);
        if (p != str)
@@ -86,7 +86,7 @@ static void strip(char *str)
        if (!l)
                return;
        p = str + l - 1;
-       while ((isspace(*p)))
+       while ((isspace((int)*p)))
                *p-- = 0;
 }
 
@@ -358,7 +358,7 @@ static int conf_choice(struct menu *menu)
                        continue;
                }
                if (line[0]) {
-                       len = strlen(line) - 1;
+                       len = strlen(line);
                        line[len] = 0;
 
                        def_menu = NULL;
index d3df3ab..9e413b4 100644 (file)
@@ -40,7 +40,7 @@ static char *conf_expand_value(const char *in)
                strncat(res_value, in, src - in);
                src++;
                dst = name;
-               while (isalnum(*src) || *src == '_')
+               while (isalnum((int)*src) || *src == '_')
                        *dst++ = *src++;
                *dst = 0;
                sym = sym_lookup(name, 0);
index 2ebc188..dad2f5f 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sys/ioctl.h>
 #include <sys/wait.h>
+#include <sys/termios.h>
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -443,7 +444,7 @@ static void conf(struct menu *menu)
                if (!type)
                        continue;
 
-               for (i = 0; input_buf[i] && !isspace(input_buf[i]); i++)
+               for (i = 0; input_buf[i] && !isspace((int)input_buf[i]); i++)
                        ;
                if (i >= sizeof(active_entry))
                        i = sizeof(active_entry) - 1;
index 7ec2ff4..f2d0015 100644 (file)
@@ -404,12 +404,12 @@ bool sym_string_valid(struct symbol *sym, const char *str)
                ch = *str++;
                if (ch == '-')
                        ch = *str++;
-               if (!isdigit(ch))
+               if (!isdigit((int)ch))
                        return false;
                if (ch == '0' && *str != 0)
                        return false;
                while ((ch = *str++)) {
-                       if (!isdigit(ch))
+                       if (!isdigit((int)ch))
                                return false;
                }
                return true;
@@ -418,7 +418,7 @@ bool sym_string_valid(struct symbol *sym, const char *str)
                        str += 2;
                ch = *str++;
                do {
-                       if (!isxdigit(ch))
+                       if (!isxdigit((int)ch))
                                return false;
                } while ((ch = *str++));
                return true;