Browse Source

Some minor changes from Stefan Allius to make conf and
mconf compile under Solaris.

Eric Andersen 22 years ago
parent
commit
a0af35a9db
4 changed files with 9 additions and 8 deletions
  1. 3 3
      extra/config/conf.c
  2. 1 1
      extra/config/confdata.c
  3. 2 1
      extra/config/mconf.c
  4. 3 3
      extra/config/symbol.c

+ 3 - 3
extra/config/conf.c

@@ -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;

+ 1 - 1
extra/config/confdata.c

@@ -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);

+ 2 - 1
extra/config/mconf.c

@@ -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;

+ 3 - 3
extra/config/symbol.c

@@ -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;