aboutsummaryrefslogtreecommitdiffstats
path: root/demos/smime/smdec.c
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2023-03-20 14:48:33 +1000
committerTomas Mraz <tomas@openssl.org>2023-04-24 14:39:19 +0200
commit09ff84bd2752cac649f57cfbf95b49dbce1c69ee (patch)
tree9a3dbf4aa9835f2be7d874cde743f6dfa1de6293 /demos/smime/smdec.c
parenta80840c663e3409203b0235764e53d8624f74cb8 (diff)
downloadopenssl-09ff84bd2752cac649f57cfbf95b49dbce1c69ee.tar.gz
Fixup demo exit status magic numbers
The demo code is quite often block copied for new demos, so this PR changes demos to use EXIT_SUCCESS & EXIT_FAILURE instead of using 0 and 1. Internal functions use the normal notation of 0 = error, 1 = success, but the value returned by main() must use EXIT_SUCCESS and EXIT_FAILURE. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20545)
Diffstat (limited to 'demos/smime/smdec.c')
-rw-r--r--demos/smime/smdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/demos/smime/smdec.c b/demos/smime/smdec.c
index debcedd5e8..bd8ac88d93 100644
--- a/demos/smime/smdec.c
+++ b/demos/smime/smdec.c
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
X509 *rcert = NULL;
EVP_PKEY *rkey = NULL;
PKCS7 *p7 = NULL;
- int ret = 1;
+ int ret = EXIT_FAILURE;
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
@@ -59,10 +59,10 @@ int main(int argc, char **argv)
if (!PKCS7_decrypt(p7, rkey, rcert, out, 0))
goto err;
- ret = 0;
+ ret = EXIT_SUCCESS;
err:
- if (ret) {
+ if (ret != EXIT_SUCCESS) {
fprintf(stderr, "Error Signing Data\n");
ERR_print_errors_fp(stderr);
}