diff options
author | Rich Salz <rsalz@akamai.com> | 2015-04-26 13:12:04 -0400 |
---|---|---|
committer | Rich Salz <rsalz@akamai.com> | 2015-04-26 13:12:04 -0400 |
commit | 88806cfc611935981e3752dccda1685022be2e2b (patch) | |
tree | 86425ca0a7439b242bef1ddbafb8dafe11682059 /apps/opt.c | |
parent | 2f58faad668ee1b4270611d6548c9fbe78589fe6 (diff) |
Fix main build breakage.
A variable declaration got dropped during a merge.
And if a compiler inlines strcmp() and you put a strcmp in an
assert message, the resultant stringification exceeds ANSI string
limits.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Diffstat (limited to 'apps/opt.c')
-rw-r--r-- | apps/opt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/opt.c b/apps/opt.c index 3706739c03..df2bea5504 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -171,7 +171,7 @@ char *opt_init(int ac, char **av, const OPTIONS *o) for (; o->name; ++o) { const OPTIONS *next; #ifndef NDEBUG - int i; + int duplicated, i; #endif if (o->name == OPT_HELP_STR || o->name == OPT_MORE_STR) @@ -188,11 +188,12 @@ char *opt_init(int ac, char **av, const OPTIONS *o) || i == 'f' || i == 'F'); /* Make sure there are no duplicates. */ - for (next = o; (++next)->name;) { + for (next = o + 1; next->name; ++next) { /* - * do allow aliases: assert(o->retval != next->retval); + * Some compilers inline strcmp and the assert string is too long. */ - assert(strcmp(o->name, next->name) != 0); + duplicated = strcmp(o->name, next->name) == 0; + assert(!duplicated); } #endif if (o->name[0] == '\0') { |