summaryrefslogtreecommitdiffstats
path: root/crypto/ct/ct_log.c
diff options
context:
space:
mode:
authorRob Percival <robpercival@google.com>2016-03-07 18:38:06 +0000
committerRich Salz <rsalz@openssl.org>2016-03-09 11:34:48 -0500
commit70073f3e3aeb3b7dd15f20b557a8340a197d976e (patch)
treeb4ed734542cef7b843b6c28b3bf9c065adc51a29 /crypto/ct/ct_log.c
parent8c92c4eac091e1a588a980514e7f5fd2a517fefc (diff)
Treat boolean functions as booleans
Use "!x" instead of "x <= 0", as these functions never return a negative value. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ct/ct_log.c')
-rw-r--r--crypto/ct/ct_log.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/ct/ct_log.c b/crypto/ct/ct_log.c
index 4f3fe3c794..f2af35b733 100644
--- a/crypto/ct/ct_log.c
+++ b/crypto/ct/ct_log.c
@@ -243,26 +243,24 @@ int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
if (load_ctx->conf == NULL)
goto end;
- ret = NCONF_load(load_ctx->conf, file, NULL);
- if (ret <= 0) {
+ if (NCONF_load(load_ctx->conf, file, NULL) <= 0) {
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
enabled_logs = NCONF_get_string(load_ctx->conf, NULL, "enabled_logs");
if (enabled_logs == NULL) {
- ret = 0;
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
- ret = CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx);
- if (ret == 1 && load_ctx->invalid_log_entries > 0) {
- ret = 0;
+ if (!CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx) ||
+ load_ctx->invalid_log_entries > 0) {
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
+ ret = 1;
end:
NCONF_free(load_ctx->conf);
ctlog_store_load_ctx_free(load_ctx);