From 03a7f82cb4e0b273afbd1de04603a26a467e94c9 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Fri, 31 Oct 2014 14:20:02 -0400 Subject: NetBSD downstream patches. const fixes. -Wconversion fixes for the skeleton files. param namespace protection (add _ to inline function parameters). unused variable/code removal. rename warn to lwarn to avoid conflict with . ctype.h function argument correction. merged the error functions lerrif and lerrsf -> lerr. --- src/scanopt.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/scanopt.c') diff --git a/src/scanopt.c b/src/scanopt.c index f76ecd3..6d8d481 100644 --- a/src/scanopt.c +++ b/src/scanopt.c @@ -46,7 +46,7 @@ static int STRCASECMP (a, b) const char *a; const char *b; { - while (tolower (*a++) == tolower (*b++)) ; + while (tolower ((unsigned char)*a++) == tolower ((unsigned char)*b++)) ; return b - a; } #endif @@ -212,7 +212,7 @@ scanopt_t *scanopt_init (options, argc, argv, flags) aux->namelen = 0; for (p = pname + 1; *p; p++) { /* detect required arg */ - if (*p == '=' || isspace (*p) + if (*p == '=' || isspace ((unsigned char)*p) || !(aux->flags & IS_LONG)) { if (aux->namelen == 0) aux->namelen = p - pname; @@ -481,7 +481,7 @@ int scanopt_usage (scanner, fp, usage) while (*p && n < maxlen[1] && *p != '\n') { - if (isspace ((Char)(*p)) + if (isspace ((unsigned char)(*p)) || *p == '-') lastws = p; n++; @@ -537,10 +537,6 @@ static int scanopt_err (s, opt_offset, is_short, err) { const char *optname = ""; char optchar[2]; - const optspec_t *opt = NULL; - - if (opt_offset >= 0) - opt = s->options + opt_offset; if (!s->no_err_msg) { -- cgit v1.2.3