summaryrefslogtreecommitdiff
path: root/src/scanopt.c
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2014-10-31 14:20:02 -0400
committerWill Estes <westes575@gmail.com>2014-11-11 21:09:36 -0500
commit03a7f82cb4e0b273afbd1de04603a26a467e94c9 (patch)
treed54aef088666875a9d94037884b00ce23437ba1b /src/scanopt.c
parent2d257614dd66f410375f24ce1f2306b3c260bd29 (diff)
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 <err.h>. ctype.h function argument correction. merged the error functions lerrif and lerrsf -> lerr.
Diffstat (limited to 'src/scanopt.c')
-rw-r--r--src/scanopt.c10
1 files changed, 3 insertions, 7 deletions
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) {