2005-09-13 Erez Zadok <ezk@cs.sunysb.edu>
+ * mk-amd-map/mk-amd-map.c (read_file_file), libamu/util.c
+ (strsplit), libamu/hasmntopt.c (nextmntopt), amd/sun_map.c
+ (sun_entry2amd), amd/sun2amd.c (sun2amd_convert_convert),
+ amd/mapc.c (mapc_add_kv), amd/info_file.c (file_search_or_reload),
+ amd/info_exec.c (exec_parse_qanswer): cast isspace() arg to
+ unsigned char, which is safer as per Christos.
+
* amd/sun_map.c (sun_entry2amd): isspace takes an int, not a char.
* configure.in: keep a dummy unused AM_PROG_LEX, because old
/*
* Find beginning of value (query answer)
*/
- for (cp = qanswer; *cp && !isascii((int)*cp) && !isspace((int)*cp); cp++)
+ for (cp = qanswer; *cp && !isascii((unsigned char)*cp) && !isspace((unsigned char)*cp); cp++)
;;
/* Ignore blank lines */
/*
* Find start of key
*/
- for (kp = key_val; *kp && isascii(*kp) && isspace((int)*kp); kp++) ;
+ for (kp = key_val; *kp && isascii(*kp) && isspace((unsigned char)*kp); kp++) ;
/*
* Ignore blank lines
/*
* Find end of key
*/
- for (cp = kp; *cp && (!isascii(*cp) || !isspace((int)*cp)); cp++) ;
+ for (cp = kp; *cp && (!isascii(*cp) || !isspace((unsigned char)*cp)); cp++) ;
/*
* Check whether key matches
*cp++ = '\0';
if (fn || (*key == *kp && STREQ(key, kp))) {
- while (*cp && isascii(*cp) && isspace((int)*cp))
+ while (*cp && isascii(*cp) && isspace((unsigned char)*cp))
cp++;
if (*cp) {
/*
while ((tok = strtok(NULL, "\n")) != NULL) {
key = tok;
/* find the entry */
- for (entry = key; *entry && !isspace((int)*entry); entry++);
+ for (entry = key; *entry && !isspace((unsigned char)*entry); entry++);
if (*entry) {
*entry++ = '\0';
}
/* find start of key */
key = line_buff;
- while (*key != '\0' && isspace((int)*key)) {
+ while (*key != '\0' && isspace((unsigned char)*key)) {
key++;
}
/* find the end of the key and NULL terminate */
tmp = key;
- while (*tmp != '\0' && isspace((int)*tmp) == 0) {
+ while (*tmp != '\0' && isspace((unsigned char)*tmp) == 0) {
tmp++;
}
if (*tmp == '\0') {
/* Make sure there are no trailing white spaces or '\n'. */
xstrlcpy(line_buff, s_entry_str, sizeof(line_buff));
ws = strlen(line_buff) - 1;
- while (ws >= 0 && (isspace((int)line_buff[ws]) || line_buff[ws] == '\n')) {
+ while (ws >= 0 && (isspace((unsigned char)line_buff[ws]) || line_buff[ws] == '\n')) {
line_buff[ws--] = '\0';
}
/*
* Skip past white space
*/
- while (*cp && isspace((int) *cp))
+ while (*cp && isspace((unsigned char) *cp))
cp++;
/*
/*
* skip to split char
*/
- while (*s && (ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch))
+ while (*s && (ch == ' ' ? (isascii(*s) && isspace((unsigned char)*s)) : *s == ch))
*s++ = '\0';
/*
/*
* skip to split char
*/
- while (*s && !(ch == ' ' ? (isascii(*s) && isspace((int)*s)) : *s == ch)) {
+ while (*s && !(ch == ' ' ? (isascii(*s) && isspace((unsigned char)*s)) : *s == ch)) {
if (*s++ == qc) {
/*
* Skip past string.
/*
* Find start of key
*/
- for (kp = key_val; *kp && isascii(*kp) && isspace((int)*kp); kp++) ;
+ for (kp = key_val; *kp && isascii(*kp) && isspace((unsigned char)*kp); kp++) ;
/*
* Ignore blank lines
/*
* Find end of key
*/
- for (cp = kp; *cp && (!isascii(*cp) || !isspace((int)*cp)); cp++) ;
+ for (cp = kp; *cp && (!isascii(*cp) || !isspace((unsigned char)*cp)); cp++) ;
/*
* Check whether key matches, or whether
*/
if (*cp)
*cp++ = '\0';
- while (*cp && isascii(*cp) && isspace((int)*cp))
+ while (*cp && isascii(*cp) && isspace((unsigned char)*cp))
cp++;
if (*kp == '+') {
fprintf(stderr, "Can't interpolate %s\n", kp);