diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-06 13:43:59 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-11 10:06:38 -0400 |
commit | 75ebbd9aa411c5b8b19ded6ace2b34181566b56a (patch) | |
tree | 6bc9cd77b2794b25f9cd9aac1c66f4626fb975a5 /apps/srp.c | |
parent | 344c271eb339fc2982e9a3584a94e51112d84584 (diff) |
Use p==NULL not !p (in if statements, mainly)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/srp.c')
-rw-r--r-- | apps/srp.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/apps/srp.c b/apps/srp.c index 111f829ca6..ec875cb9fb 100644 --- a/apps/srp.c +++ b/apps/srp.c @@ -516,10 +516,13 @@ int srp_main(int argc, char **argv) row[DB_srptype] = BUF_strdup("v"); row[DB_srpgN] = BUF_strdup(gNid); - if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype] - || !row[DB_srpverifier] || !row[DB_srpsalt] - || (userinfo && - (!(row [DB_srpinfo] = BUF_strdup (userinfo)))) + if ((row[DB_srpid] == NULL) + || (row[DB_srpgN] == NULL) + || (row[DB_srptype] == NULL) + || (row[DB_srpverifier] == NULL) + || (row[DB_srpsalt] == NULL) + || (userinfo + && ((row[DB_srpinfo] = BUF_strdup(userinfo)) == NULL)) || !update_index(db, row)) { OPENSSL_free(row[DB_srpid]); OPENSSL_free(row[DB_srpgN]); @@ -596,10 +599,14 @@ int srp_main(int argc, char **argv) row[DB_srptype][0] = 'v'; row[DB_srpgN] = BUF_strdup(gNid); - if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype] - || !row[DB_srpverifier] || !row[DB_srpsalt] + if (row[DB_srpid] == NULL + || row[DB_srpgN] == NULL + || row[DB_srptype] == NULL + || row[DB_srpverifier] == NULL + || row[DB_srpsalt] == NULL || (userinfo - && (!(row[DB_srpinfo] = BUF_strdup(userinfo))))) + && ((row[DB_srpinfo] = BUF_strdup(userinfo)) + == NULL))) goto end; doupdatedb = 1; @@ -612,12 +619,10 @@ int srp_main(int argc, char **argv) user); errors++; } else { - char **xpp = - sk_OPENSSL_PSTRING_value(db->db->data, userindex); - BIO_printf(bio_err, "user \"%s\" revoked. t\n", user); + char **xpp = sk_OPENSSL_PSTRING_value(db->db->data, userindex); + BIO_printf(bio_err, "user \"%s\" revoked. t\n", user); xpp[DB_srptype][0] = 'R'; - doupdatedb = 1; } } |