summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ejs/var.c18
-rw-r--r--source4/lib/genrand.c6
-rw-r--r--source4/lib/ldb/common/attrib_handlers.c3
-rw-r--r--source4/lib/ldb/common/ldb_dn.c2
-rw-r--r--source4/lib/ldb/common/ldb_parse.c12
-rw-r--r--source4/lib/ldb/common/ldb_utf8.c5
-rw-r--r--source4/lib/socket/socket_ipv6.c2
-rw-r--r--source4/lib/util_str.c7
-rw-r--r--source4/libcli/nbt/nbtname.c2
-rw-r--r--source4/ntvfs/posix/pvfs_shortname.c4
-rw-r--r--source4/param/loadparm.c4
-rw-r--r--source4/scripting/ejs/smbcalls_string.c2
-rw-r--r--source4/utils/nmblookup.c2
13 files changed, 36 insertions, 33 deletions
diff --git a/source4/lib/ejs/var.c b/source4/lib/ejs/var.c
index 7cbf8a0b7f..9d2afe5306 100644
--- a/source4/lib/ejs/var.c
+++ b/source4/lib/ejs/var.c
@@ -1730,18 +1730,18 @@ MprVar mprParseVar(char *buf, MprType preferredType)
} else if (isdigit((int) *buf)) {
type = MPR_NUM_VAR;
cp = buf;
- if (*cp && tolower(cp[1]) == 'x') {
+ if (*cp && tolower((unsigned char)cp[1]) == 'x') {
cp = &cp[2];
}
for (cp = buf; *cp; cp++) {
- if (! isdigit((int) *cp)) {
+ if (! isdigit((unsigned char) *cp)) {
break;
}
}
if (*cp != '\0') {
#if BLD_FEATURE_FLOATING_POINT
- if (*cp == '.' || tolower(*cp) == 'e') {
+ if (*cp == '.' || tolower((unsigned char)*cp) == 'e') {
type = MPR_TYPE_FLOAT;
} else
#endif
@@ -1993,11 +1993,11 @@ int64 mprParseInteger64(char *str)
}
} else {
cp++;
- if (tolower(*cp) == 'x') {
+ if (tolower((unsigned char)*cp) == 'x') {
cp++;
radix = 16;
while (*cp) {
- c = tolower(*cp);
+ c = tolower((unsigned char)*cp);
if (isdigit(c)) {
num64 = (c - '0') + (num64 * radix);
} else if (c >= 'a' && c <= 'f') {
@@ -2011,7 +2011,7 @@ int64 mprParseInteger64(char *str)
} else{
radix = 8;
while (*cp) {
- c = tolower(*cp);
+ c = tolower((unsigned char)*cp);
if (isdigit(c) && c < '8') {
num64 = (c - '0') + (num64 * radix);
} else {
@@ -2110,11 +2110,11 @@ int mprParseInteger(char *str)
}
} else {
cp++;
- if (tolower(*cp) == 'x') {
+ if (tolower((unsigned char)*cp) == 'x') {
cp++;
radix = 16;
while (*cp) {
- c = tolower(*cp);
+ c = tolower((unsigned char)*cp);
if (isdigit(c)) {
num = (c - '0') + (num * radix);
} else if (c >= 'a' && c <= 'f') {
@@ -2128,7 +2128,7 @@ int mprParseInteger(char *str)
} else{
radix = 8;
while (*cp) {
- c = tolower(*cp);
+ c = tolower((unsigned char)*cp);
if (isdigit(c) && c < '8') {
num = (c - '0') + (num * radix);
} else {
diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c
index 9d40e72afc..ca79116b6a 100644
--- a/source4/lib/genrand.c
+++ b/source4/lib/genrand.c
@@ -261,11 +261,11 @@ BOOL check_password_quality(const char *s)
{
int has_digit=0, has_capital=0, has_lower=0;
while (*s) {
- if (isdigit(*s)) {
+ if (isdigit((unsigned char)*s)) {
has_digit++;
- } else if (isupper(*s)) {
+ } else if (isupper((unsigned char)*s)) {
has_capital++;
- } else if (islower(*s)) {
+ } else if (islower((unsigned char)*s)) {
has_lower++;
}
s++;
diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c
index 7f71d3574a..da2d945419 100644
--- a/source4/lib/ldb/common/attrib_handlers.c
+++ b/source4/lib/ldb/common/attrib_handlers.c
@@ -128,7 +128,8 @@ static int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx,
while (*s2 == ' ') s2++;
/* TODO: make utf8 safe, possibly with helper function from application */
while (*s1 && *s2) {
- if (toupper(*s1) != toupper(*s2)) break;
+ if (toupper((unsigned char)*s1) != toupper((unsigned char)*s2))
+ break;
if (*s1 == ' ') {
while (s1[0] == s1[1]) s1++;
while (s2[0] == s2[1]) s2++;
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index b421a7fe75..32b575dd36 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -47,7 +47,7 @@ static int ldb_dn_is_valid_attribute_name(const char *name)
if (! isascii(*name)) {
return 0;
}
- if (! (isalnum(*name) || *name == '-')) {
+ if (! (isalnum((unsigned char)*name) || *name == '-')) {
return 0;
}
name++;
diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c
index b519489b48..ad3cbd883d 100644
--- a/source4/lib/ldb/common/ldb_parse.c
+++ b/source4/lib/ldb/common/ldb_parse.c
@@ -68,7 +68,7 @@ static char *ldb_parse_lex(void *ctx, const char **s, const char *sep)
const char *p = *s;
char *ret;
- while (isspace(*p)) {
+ while (isspace((unsigned char)*p)) {
p++;
}
*s = p;
@@ -86,7 +86,7 @@ static char *ldb_parse_lex(void *ctx, const char **s, const char *sep)
return ret;
}
- while (*p && (isalnum(*p) || !strchr(sep, *p))) {
+ while (*p && (isalnum((unsigned char)*p) || !strchr(sep, *p))) {
p++;
}
@@ -423,7 +423,7 @@ static struct ldb_parse_tree *ldb_parse_filterlist(void *mem_ctx,
return NULL;
}
- while (isspace(*s)) s++;
+ while (isspace((unsigned char)*s)) s++;
while (*s && (next = ldb_parse_filter(ret->u.list.elements, &s))) {
struct ldb_parse_tree **e;
@@ -438,7 +438,7 @@ static struct ldb_parse_tree *ldb_parse_filterlist(void *mem_ctx,
ret->u.list.elements = e;
ret->u.list.elements[ret->u.list.num_elements] = next;
ret->u.list.num_elements++;
- while (isspace(*s)) s++;
+ while (isspace((unsigned char)*s)) s++;
}
return ret;
@@ -474,7 +474,7 @@ static struct ldb_parse_tree *ldb_parse_not(void *mem_ctx, const char *s)
*/
static struct ldb_parse_tree *ldb_parse_filtercomp(void *mem_ctx, const char *s)
{
- while (isspace(*s)) s++;
+ while (isspace((unsigned char)*s)) s++;
switch (*s) {
case '&':
@@ -543,7 +543,7 @@ static struct ldb_parse_tree *ldb_parse_filter(void *mem_ctx, const char **s)
*/
struct ldb_parse_tree *ldb_parse_tree(void *mem_ctx, const char *s)
{
- while (isspace(*s)) s++;
+ while (isspace((unsigned char)*s)) s++;
if (*s == '(') {
return ldb_parse_filter(mem_ctx, &s);
diff --git a/source4/lib/ldb/common/ldb_utf8.c b/source4/lib/ldb/common/ldb_utf8.c
index 38c117d7e0..5df5a6bba7 100644
--- a/source4/lib/ldb/common/ldb_utf8.c
+++ b/source4/lib/ldb/common/ldb_utf8.c
@@ -50,7 +50,7 @@ char *ldb_casefold(void *mem_ctx, const char *s)
return NULL;
}
for (i=0;ret[i];i++) {
- ret[i] = toupper(ret[i]);
+ ret[i] = toupper((unsigned char)ret[i]);
}
return ret;
}
@@ -63,7 +63,8 @@ int ldb_caseless_cmp(const char *s1, const char *s2)
{
int i;
for (i=0;s1[i] != 0;i++) {
- int c1 = toupper(s1[i]), c2 = toupper(s2[i]);
+ int c1 = toupper((unsigned char)s1[i]),
+ c2 = toupper((unsigned char)s2[i]);
if (c1 != c2) {
return c1 - c2;
}
diff --git a/source4/lib/socket/socket_ipv6.c b/source4/lib/socket/socket_ipv6.c
index 25c5ca5798..58e35d87de 100644
--- a/source4/lib/socket/socket_ipv6.c
+++ b/source4/lib/socket/socket_ipv6.c
@@ -290,7 +290,7 @@ static char *ipv6_tcp_get_peer_addr(struct socket_context *sock, TALLOC_CTX *mem
return NULL;
}
- he = gethostbyaddr(&peer_addr.sin6_addr, sizeof(peer_addr.sin6_addr), AF_INET6);
+ he = gethostbyaddr((char *)&peer_addr.sin6_addr, sizeof(peer_addr.sin6_addr), AF_INET6);
if (!he || !he->h_name) {
return NULL;
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index fea7170014..592c38e53c 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -159,7 +159,8 @@ int strwicmp(const char *psz1, const char *psz2)
psz1++;
while (isspace((int)*psz2))
psz2++;
- if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0'
+ if (toupper((unsigned char)*psz1) != toupper((unsigned char)*psz2)
+ || *psz1 == '\0'
|| *psz2 == '\0')
break;
psz1++;
@@ -412,12 +413,12 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex)
continue;
}
- if (!(p1 = strchr_m(hexchars, toupper(strhex[i]))))
+ if (!(p1 = strchr_m(hexchars, toupper((unsigned char)strhex[i]))))
break;
i++; /* next hex digit */
- if (!(p2 = strchr_m(hexchars, toupper(strhex[i]))))
+ if (!(p2 = strchr_m(hexchars, toupper((unsigned char)strhex[i]))))
break;
/* get the two nybbles */
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index b59c24e7cf..36ffdc9af6 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -429,7 +429,7 @@ static const char *nbt_hex_encode(TALLOC_CTX *mem_ctx, const char *s)
int i, len;
char *ret;
const char *valid_chars = "_-.$@ ";
-#define NBT_CHAR_ALLOW(c) (isalnum(c) || strchr(valid_chars, c))
+#define NBT_CHAR_ALLOW(c) (isalnum((unsigned char)c) || strchr(valid_chars, c))
for (len=i=0;s[i];i++,len++) {
if (!NBT_CHAR_ALLOW(s[i])) {
diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c
index 59a3d34640..eb797dc7aa 100644
--- a/source4/ntvfs/posix/pvfs_shortname.c
+++ b/source4/ntvfs/posix/pvfs_shortname.c
@@ -469,7 +469,7 @@ static char *name_map(struct pvfs_mangle_context *ctx,
if (! FLAG_CHECK(lead_chars[i], FLAG_ASCII)) {
lead_chars[i] = '_';
}
- lead_chars[i] = toupper(lead_chars[i]);
+ lead_chars[i] = toupper((unsigned char)lead_chars[i]);
}
for (;i<ctx->mangle_prefix;i++) {
lead_chars[i] = '_';
@@ -487,7 +487,7 @@ static char *name_map(struct pvfs_mangle_context *ctx,
extension_length = 0;
if (dot_p) {
for (i=1; extension_length < 3 && dot_p[i]; i++) {
- char c = dot_p[i];
+ unsigned char c = dot_p[i];
if (FLAG_CHECK(c, FLAG_ASCII)) {
extension[extension_length++] = toupper(c);
}
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 0b1eb2dcd6..354318b2bd 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2283,7 +2283,7 @@ static BOOL lp_do_parameter_parametric(int snum, const char *pszParmName, const
struct param_opt *paramo, *data;
char *name;
- while (isspace(*pszParmName)) {
+ while (isspace((unsigned char)*pszParmName)) {
pszParmName++;
}
@@ -2485,7 +2485,7 @@ BOOL lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
int parmnum = map_parameter(pszParmName);
int i;
- while (isspace(*pszParmValue)) pszParmValue++;
+ while (isspace((unsigned char)*pszParmValue)) pszParmValue++;
if (parmnum < 0 && strchr(pszParmName, ':')) {
diff --git a/source4/scripting/ejs/smbcalls_string.c b/source4/scripting/ejs/smbcalls_string.c
index 6597f3b27b..46369cdee7 100644
--- a/source4/scripting/ejs/smbcalls_string.c
+++ b/source4/scripting/ejs/smbcalls_string.c
@@ -198,7 +198,7 @@ static int ejs_sprintf(MprVarHandle eid, int argc, struct MprVar **argv)
len_count = count_chars(fmt2, '*');
/* find the type string */
tstr = &fmt2[len];
- while (tstr > fmt2 && isalpha(tstr[-1])) {
+ while (tstr > fmt2 && isalpha((unsigned char)tstr[-1])) {
tstr--;
}
if (strcmp(tstr, "%") == 0) {
diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c
index 900d55d6df..c8490d08e6 100644
--- a/source4/utils/nmblookup.c
+++ b/source4/utils/nmblookup.c
@@ -49,7 +49,7 @@ static const char *clean_name(TALLOC_CTX *mem_ctx, const char *name)
char *ret = talloc_strdup(mem_ctx, name);
int i;
for (i=0;ret[i];i++) {
- if (!isprint(ret[i])) ret[i] = '.';
+ if (!isprint((unsigned char)ret[i])) ret[i] = '.';
}
return ret;
}