From d7274260ed4e6d97de6af8a6a3c0740ee6c837a4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 24 Mar 2007 11:23:08 +0000 Subject: [PATCH] Cast the argument of functions to 'unsigned char'. --- ChangeLog | 5 +++++ lib/argp-help.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74a480030..804e38178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-24 Bruno Haible + + * lib/argp-help.c (fill_in_uparams, canon_doc_option): Cast the + arguments of isspace, isalpha, isalnum, isdigit to 'unsigned char'. + 2007-03-22 Bruno Haible * lib/strptime.c (__strptime_internal): Use ANSI C syntax. diff --git a/lib/argp-help.c b/lib/argp-help.c index e7baaf9ff..732148082 100644 --- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -1,5 +1,5 @@ /* Hierarchial argument parsing help output - Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2005, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -162,7 +162,7 @@ fill_in_uparams (const struct argp_state *state) const char *var = getenv ("ARGP_HELP_FMT"); struct uparams new_params = uparams; -#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0); +#define SKIPWS(p) do { while (isspace ((unsigned char) *p)) p++; } while (0); if (var) { @@ -171,14 +171,14 @@ fill_in_uparams (const struct argp_state *state) { SKIPWS (var); - if (isalpha (*var)) + if (isalpha ((unsigned char) *var)) { size_t var_len; const struct uparam_name *un; int unspec = 0, val = 0; const char *arg = var; - while (isalnum (*arg) || *arg == '-' || *arg == '_') + while (isalnum ((unsigned char) *arg) || *arg == '-' || *arg == '_') arg++; var_len = arg - var; @@ -203,10 +203,10 @@ fill_in_uparams (const struct argp_state *state) else val = 1; } - else if (isdigit (*arg)) + else if (isdigit ((unsigned char) *arg)) { val = atoi (arg); - while (isdigit (*arg)) + while (isdigit ((unsigned char) *arg)) arg++; SKIPWS (arg); } @@ -720,12 +720,12 @@ canon_doc_option (const char **name) else { /* Skip initial whitespace. */ - while (isspace (**name)) + while (isspace ((unsigned char) **name)) (*name)++; /* Decide whether this looks like an option (leading `-') or not. */ non_opt = (**name != '-'); /* Skip until part of name used for sorting. */ - while (**name && !isalnum (**name)) + while (**name && !isalnum ((unsigned char) **name)) (*name)++; } return non_opt; -- 2.11.0