diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-09-24 13:37:16 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-01-25 09:06:34 +0000 |
commit | d2a56999985ccf56ea6c82e6fa2f91c345bbc9d3 (patch) | |
tree | ce01aa43b9446862e64c01c383a300a63352243a /crypto/x509/x509name.c | |
parent | 28b86f313b43cc70d11054d3830ef82e7af8290a (diff) |
Few nit's
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1618)
Diffstat (limited to 'crypto/x509/x509name.c')
-rw-r--r-- | crypto/x509/x509name.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c index 919d8c1e7f..ab53794741 100644 --- a/crypto/x509/x509name.c +++ b/crypto/x509/x509name.c @@ -86,9 +86,9 @@ X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc) { if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc || loc < 0) - return (NULL); - else - return (sk_X509_NAME_ENTRY_value(name->entries, loc)); + return NULL; + + return sk_X509_NAME_ENTRY_value(name->entries, loc); } X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) @@ -99,13 +99,14 @@ X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc || loc < 0) - return (NULL); + return NULL; + sk = name->entries; ret = sk_X509_NAME_ENTRY_delete(sk, loc); n = sk_X509_NAME_ENTRY_num(sk); name->modified = 1; if (loc == n) - return (ret); + return ret; /* else we need to fixup the set field */ if (loc != 0) @@ -127,7 +128,7 @@ X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) if (set_prev + 1 < set_next) for (i = loc; i < n; i++) sk_X509_NAME_ENTRY_value(sk, i)->set--; - return (ret); + return ret; } int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, @@ -136,6 +137,7 @@ int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type { X509_NAME_ENTRY *ne; int ret; + ne = X509_NAME_ENTRY_create_by_OBJ(NULL, obj, type, bytes, len); if (!ne) return 0; |