summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-22 21:58:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-22 21:58:37 +0100
commit97a6bf07012f5a55d16f28c3bb3d039a09f8d700 (patch)
treeb6eb6b1932a4cdb5eb7d9dbc2a294f0a8de2ef66 /soltools
parentcea11039b29cffa0c8045ead30ddfc4859595c7e (diff)
Fix passing plain char into ctype.h is* functions
Change-Id: I4de56462e1fe5bba3035fec691feda91be88b434
Diffstat (limited to 'soltools')
-rw-r--r--soltools/cpp/_unix.c2
-rw-r--r--soltools/mkdepend/cppsetup.c2
-rw-r--r--soltools/mkdepend/ifparser.c14
-rw-r--r--soltools/mkdepend/parse.c4
4 files changed, 11 insertions, 11 deletions
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 1010e3084eb6..274ee5acaf3a 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -149,7 +149,7 @@ void
case 'w':
dp = &optarg[n + 1];
n += (int)strlen(dp);
- while (isspace(*dp)) dp++;
+ while (isspace((unsigned char)*dp)) dp++;
for (i = NINCLUDE - 1; i >= 0; i--)
{
diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c
index 708e75dc099e..750142af9ddf 100644
--- a/soltools/mkdepend/cppsetup.c
+++ b/soltools/mkdepend/cppsetup.c
@@ -174,7 +174,7 @@ my_eval_defined (IfParser *ip, const char *var, size_t len)
return 0;
}
-#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
+#define isvarfirstletter(ccc) (isalpha((unsigned char)(ccc)) || (ccc) == '_')
static int
my_eval_variable (IfParser *ip, const char *var, size_t len)
diff --git a/soltools/mkdepend/ifparser.c b/soltools/mkdepend/ifparser.c
index 274a72a7fce8..8777e795f18e 100644
--- a/soltools/mkdepend/ifparser.c
+++ b/soltools/mkdepend/ifparser.c
@@ -69,8 +69,8 @@
#define DO(val) if (!(val)) return NULL
#define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff))
-#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++
-#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
+#define SKIPSPACE(ccc) while (isspace((unsigned char)*ccc)) ccc++
+#define isvarfirstletter(ccc) (isalpha((unsigned char)(ccc)) || (ccc) == '_')
static const char *
@@ -83,7 +83,7 @@ parse_variable (IfParser *g, const char *cp, const char **varp)
*varp = cp;
/* EMPTY */
- for (cp++; isalnum(*cp) || *cp == '_'; cp++) ;
+ for (cp++; isalnum((unsigned char)*cp) || *cp == '_'; cp++) ;
return cp;
}
@@ -93,7 +93,7 @@ parse_number (IfParser *g, const char *cp, int *valp)
{
SKIPSPACE (cp);
- if (!isdigit(*cp))
+ if (!isdigit((unsigned char)*cp))
return CALLFUNC(g, handle_error) (g, cp, "number");
#ifdef _WIN32
@@ -104,7 +104,7 @@ parse_number (IfParser *g, const char *cp, int *valp)
#else
*valp = atoi (cp);
/* EMPTY */
- for (cp++; isdigit(*cp); cp++) ;
+ for (cp++; isdigit((unsigned char)*cp); cp++) ;
#endif
return cp;
}
@@ -155,7 +155,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
return cp + 1;
case 'd':
- if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) {
+ if (strncmp (cp, "defined", 7) == 0 && !isalnum((unsigned char)cp[7])) {
int paren = 0;
size_t len;
@@ -176,7 +176,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
/* fall out */
}
- if (isdigit(*cp)) {
+ if (isdigit((unsigned char)*cp)) {
DO (cp = parse_number (g, cp, valp));
} else if (!isvarfirstletter(*cp))
return CALLFUNC(g, handle_error) (g, cp, "variable or number");
diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index 250a6a66a702..41ae113e9ff0 100644
--- a/soltools/mkdepend/parse.c
+++ b/soltools/mkdepend/parse.c
@@ -293,7 +293,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st
/*
* separate the name of a single symbol.
*/
- while (isalnum(*p) || *p == '_')
+ while (isalnum((unsigned char)*p) || *p == '_')
*line++ = *p++;
*line = '\0';
break;
@@ -385,7 +385,7 @@ void define( char *def, struct symhash **symbols )
/* Separate symbol name and its value */
val = def;
- while (isalnum(*val) || *val == '_')
+ while (isalnum((unsigned char)*val) || *val == '_')
val++;
if (*val)
*val++ = '\0';