* lib/argp-help.c (canon_doc_option): Cast character to 'unsigned int'
before passing it to isspace() or isalnum().
+2020-12-08 Bruno Haible <bruno@clisp.org>
+
+ argp: Don't pass invalid arguments to isspace() and isalnum().
+ * lib/argp-help.c (canon_doc_option): Cast character to 'unsigned int'
+ before passing it to isspace() or isalnum().
+
2020-12-08 Bruno Haible <bruno@clisp.org>
argp: Don't rely on undefined behaviour of _tolower().
{
int non_opt;
/* 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;
}