diff options
author | Pauli <paul.dale@oracle.com> | 2017-07-27 14:54:27 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-07-27 14:54:27 +1000 |
commit | 52b6e17da4c8eea982a19d1a1f34ba24416fb73e (patch) | |
tree | 77ac375597ba0ad55487f06e26a6b10a44d790f4 /crypto/asn1/a_time.c | |
parent | d67e755418b62fb451ec221c126c9935a06ea63b (diff) |
Fix trivial coding style nits in a_time/a_tm files
Clean up some true/false returns
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/4001)
Diffstat (limited to 'crypto/asn1/a_time.c')
-rw-r--r-- | crypto/asn1/a_time.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index e5b5f9a052..83c57ce7a6 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -297,8 +297,9 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, if (out == NULL || *out == NULL) { if ((ret = ASN1_GENERALIZEDTIME_new()) == NULL) goto err; - } else + } else { ret = *out; + } /* If already GeneralizedTime just copy across */ if (t->type == V_ASN1_GENERALIZEDTIME) { @@ -349,7 +350,7 @@ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str) return 0; } - if (s && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) + if (s != NULL && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) return 0; return 1; @@ -421,7 +422,7 @@ int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm) time(&now_t); memset(tm, 0, sizeof(*tm)); - if (OPENSSL_gmtime(&now_t, tm)) + if (OPENSSL_gmtime(&now_t, tm) != NULL) return 1; return 0; } @@ -448,5 +449,5 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) if (tm->type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_print(bp, tm); BIO_write(bp, "Bad time value", 14); - return (0); + return 0; } |