From e2784ea0eadb4672a77993d540ef3be8ed05f3be Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 14 Feb 2015 13:32:46 +0000 Subject: Spell NULL correctly, be explicit with NULL checks and it is also easier to initialise during declaration and drop the else statement. ok doug@ miod@ --- src/lib/libcrypto/asn1/tasn_fre.c | 8 +++----- src/lib/libcrypto/asn1/tasn_new.c | 8 +++----- src/lib/libssl/src/crypto/asn1/tasn_fre.c | 8 +++----- src/lib/libssl/src/crypto/asn1/tasn_new.c | 8 +++----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c index d8d55a536c..36b668a7f9 100644 --- a/src/lib/libcrypto/asn1/tasn_fre.c +++ b/src/lib/libcrypto/asn1/tasn_fre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */ +/* $OpenBSD: tasn_fre.c,v 1.13 2015/02/14 13:32:46 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -86,16 +86,14 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) const ASN1_EXTERN_FUNCS *ef; const ASN1_COMPAT_FUNCS *cf; const ASN1_AUX *aux = it->funcs; - ASN1_aux_cb *asn1_cb; + ASN1_aux_cb *asn1_cb = NULL; int i; if (pval == NULL || *pval == NULL) return; - if (aux && aux->asn1_cb) + if (aux != NULL && aux->asn1_cb != NULL) asn1_cb = aux->asn1_cb; - else - asn1_cb = 0; switch (it->itype) { case ASN1_ITYPE_PRIMITIVE: diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c index 88ee5c5224..cbc6bfc1d5 100644 --- a/src/lib/libcrypto/asn1/tasn_new.c +++ b/src/lib/libcrypto/asn1/tasn_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_new.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -94,14 +94,12 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) const ASN1_COMPAT_FUNCS *cf; const ASN1_EXTERN_FUNCS *ef; const ASN1_AUX *aux = it->funcs; - ASN1_aux_cb *asn1_cb; + ASN1_aux_cb *asn1_cb = NULL; ASN1_VALUE **pseqval; int i; - if (aux && aux->asn1_cb) + if (aux != NULL && aux->asn1_cb != NULL) asn1_cb = aux->asn1_cb; - else - asn1_cb = 0; if (!combine) *pval = NULL; diff --git a/src/lib/libssl/src/crypto/asn1/tasn_fre.c b/src/lib/libssl/src/crypto/asn1/tasn_fre.c index d8d55a536c..36b668a7f9 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_fre.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_fre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */ +/* $OpenBSD: tasn_fre.c,v 1.13 2015/02/14 13:32:46 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -86,16 +86,14 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) const ASN1_EXTERN_FUNCS *ef; const ASN1_COMPAT_FUNCS *cf; const ASN1_AUX *aux = it->funcs; - ASN1_aux_cb *asn1_cb; + ASN1_aux_cb *asn1_cb = NULL; int i; if (pval == NULL || *pval == NULL) return; - if (aux && aux->asn1_cb) + if (aux != NULL && aux->asn1_cb != NULL) asn1_cb = aux->asn1_cb; - else - asn1_cb = 0; switch (it->itype) { case ASN1_ITYPE_PRIMITIVE: diff --git a/src/lib/libssl/src/crypto/asn1/tasn_new.c b/src/lib/libssl/src/crypto/asn1/tasn_new.c index 88ee5c5224..cbc6bfc1d5 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_new.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_new.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -94,14 +94,12 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) const ASN1_COMPAT_FUNCS *cf; const ASN1_EXTERN_FUNCS *ef; const ASN1_AUX *aux = it->funcs; - ASN1_aux_cb *asn1_cb; + ASN1_aux_cb *asn1_cb = NULL; ASN1_VALUE **pseqval; int i; - if (aux && aux->asn1_cb) + if (aux != NULL && aux->asn1_cb != NULL) asn1_cb = aux->asn1_cb; - else - asn1_cb = 0; if (!combine) *pval = NULL; -- cgit v1.2.3-55-g6feb