From: Ezra Peisach Date: Mon, 11 Jun 2001 21:55:49 +0000 (+0000) Subject: * argv_parse.c (argv_parse): Cast argument to isspace() as int. X-Git-Tag: krb5-1.3-alpha1~1427 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa2a375ef265c9375b9293f614eb5d848d5f1d48;p=krb5.git * argv_parse.c (argv_parse): Cast argument to isspace() as int. * prof_parse.c (skip_over_blanks, parse_std_line, need_double_quotes): Likewise On some systems, isspace() is a macro indexing an array. Gcc warns on indexing an array with a char. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13335 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 22c5179d2..9f4c4a373 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,9 @@ +2001-06-11 Ezra Peisach + + * argv_parse.c (argv_parse): Cast argument to isspace() as int. + * prof_parse.c (skip_over_blanks, parse_std_line, need_double_quotes): + Likewise + 2001-06-11 Ezra Peisach * Makefile.in (MLIBS): Do not link against libgen.a for test diff --git a/src/util/profile/argv_parse.c b/src/util/profile/argv_parse.c index 5d595b9c1..539517ad7 100644 --- a/src/util/profile/argv_parse.c +++ b/src/util/profile/argv_parse.c @@ -55,7 +55,7 @@ int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv) outcp = buf; for (cp = in_buf; (ch = *cp); cp++) { if (state == STATE_WHITESPACE) { - if (isspace(ch)) + if (isspace((int) ch)) continue; /* Not whitespace, so start a new token */ state = STATE_TOKEN; @@ -80,7 +80,7 @@ int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv) continue; } /* Must be processing characters in a word */ - if (isspace(ch)) { + if (isspace((int) ch)) { /* * Terminate the current word and start * looking for the beginning of the next word. diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c index 7e8bcb873..e1645ecd7 100644 --- a/src/util/profile/prof_parse.c +++ b/src/util/profile/prof_parse.c @@ -24,7 +24,7 @@ struct parse_state { static char *skip_over_blanks(cp) char *cp; { - while (*cp && isspace(*cp)) + while (*cp && isspace((int) (*cp))) cp++; return cp; } @@ -177,7 +177,7 @@ static errcode_t parse_std_line(line, state) do_subsection++; else { cp = value + strlen(value) - 1; - while ((cp > value) && isspace(*cp)) + while ((cp > value) && isspace((int) (*cp))) *cp-- = 0; } if (do_subsection) { @@ -265,7 +265,7 @@ static int need_double_quotes(str) { if (!str || !*str) return 0; - if (isspace(*str) ||isspace(*(str + strlen(str) - 1))) + if (isspace((int) (*str)) ||isspace((int) (*(str + strlen(str) - 1)))) return 1; if (strchr(str, '\n') || strchr(str, '\t') || strchr(str, '\b')) return 1;