From 5f56994d79a94739dff6ef7429f3f6351bc0a9d7 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: May 07 2015 20:42:23 +0000 Subject: Fix a static analysis warning Static analysis confirms that "id" can't be NULL - it's either "0", a value from the environment, or a value from the command line. --- diff --git a/src/scep.c b/src/scep.c index 6748052..24fac6e 100644 --- a/src/scep.c +++ b/src/scep.c @@ -296,20 +296,11 @@ main(int argc, char **argv) missing_args = TRUE; break; case op_get_ca_caps: - if (id == NULL) { - params = "operation=" OP_GET_CA_CAPS; - } else { - params = talloc_asprintf(ctx, "operation=" OP_GET_CA_CAPS "&message=%s", id); - } + params = talloc_asprintf(ctx, "operation=" OP_GET_CA_CAPS "&message=%s", id); break; case op_get_ca_certs: - if (id == NULL) { - params = "operation=" OP_GET_CA_CERT; - params2 = "operation=" OP_GET_CA_CHAIN; - } else { - params = talloc_asprintf(ctx, "operation=" OP_GET_CA_CERT "&message=%s", id); - params2 = talloc_asprintf(ctx, "operation=" OP_GET_CA_CHAIN "&message=%s", id); - } + params = talloc_asprintf(ctx, "operation=" OP_GET_CA_CERT "&message=%s", id); + params2 = talloc_asprintf(ctx, "operation=" OP_GET_CA_CHAIN "&message=%s", id); break; case op_get_initial_cert: if ((racert == NULL) || (strlen(racert) == 0)) {