diff options
author | Rich Salz <rsalz@openssl.org> | 2016-08-30 13:31:18 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-09-22 08:36:26 -0400 |
commit | f3b3d7f0033080f86ede5a53e8af2fb313091b5a (patch) | |
tree | c3761c9e3503980b7a2933211424165adad3fa8d /apps/ts.c | |
parent | 39c136cc53d7b6fafdd1a0b52c035fd24358e01c (diff) |
Add -Wswitch-enum
Change code so when switching on an enumeration, have case's for all
enumeration values.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/ts.c')
-rw-r--r-- | apps/ts.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -296,19 +296,14 @@ int ts_main(int argc, char **argv) goto end; /* Check parameter consistency and execute the appropriate function. */ - switch (mode) { - default: - case OPT_ERR: - goto opthelp; - case OPT_QUERY: + if (mode == OPT_QUERY) { if (vpmtouched) goto opthelp; if ((data != NULL) && (digest != NULL)) goto opthelp; ret = !query_command(data, digest, md, policy, no_nonce, cert, in, out, text); - break; - case OPT_REPLY: + } else if (mode == OPT_REPLY) { if (vpmtouched) goto opthelp; if ((in != NULL) && (queryfile != NULL)) @@ -320,13 +315,15 @@ int ts_main(int argc, char **argv) ret = !reply_command(conf, section, engine, queryfile, password, inkey, md, signer, chain, policy, in, token_in, out, token_out, text); - break; - case OPT_VERIFY: + + } else if (mode == OPT_VERIFY) { if ((in == NULL) || !EXACTLY_ONE(queryfile, data, digest)) goto opthelp; ret = !verify_command(data, digest, queryfile, in, token_in, CApath, CAfile, untrusted, vpmtouched ? vpm : NULL); + } else { + goto opthelp; } end: |