diff options
author | Ezra Peisach <epeisach@mit.edu> | 2001-06-11 21:55:49 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2001-06-11 21:55:49 +0000 |
commit | aa2a375ef265c9375b9293f614eb5d848d5f1d48 (patch) | |
tree | 087145181a90bba79cfed1fe92ade2fc3e8692ee /src | |
parent | 02a38199507d89173b8e8f26ad347d64c9f45114 (diff) | |
download | krb5-aa2a375ef265c9375b9293f614eb5d848d5f1d48.zip krb5-aa2a375ef265c9375b9293f614eb5d848d5f1d48.tar.gz krb5-aa2a375ef265c9375b9293f614eb5d848d5f1d48.tar.bz2 |
* 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
Diffstat (limited to 'src')
-rw-r--r-- | src/util/profile/ChangeLog | 6 | ||||
-rw-r--r-- | src/util/profile/argv_parse.c | 4 | ||||
-rw-r--r-- | src/util/profile/prof_parse.c | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 22c5179..9f4c4a3 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,5 +1,11 @@ 2001-06-11 Ezra Peisach <epeisach@mit.edu> + * 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 <epeisach@mit.edu> + * Makefile.in (MLIBS): Do not link against libgen.a for test programs. (only needed for krb5 an_to_ln code). diff --git a/src/util/profile/argv_parse.c b/src/util/profile/argv_parse.c index 5d595b9..539517a 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 7e8bcb8..e1645ec 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; |