From: jsing Date: Mon, 22 Aug 2016 17:08:10 +0000 (+0000) Subject: Stick with the usual 'if NULL return NULL' idiom. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b50cee5a2fb875c448e4a9a665f09cf28335d0b6;p=openbsd Stick with the usual 'if NULL return NULL' idiom. ok beck@ --- diff --git a/lib/libtls/tls_peer.c b/lib/libtls/tls_peer.c index 8a74613ef82..802a9c2780d 100644 --- a/lib/libtls/tls_peer.c +++ b/lib/libtls/tls_peer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_peer.c,v 1.5 2015/10/07 23:33:38 beck Exp $ */ +/* $OpenBSD: tls_peer.c,v 1.6 2016/08/22 17:08:10 jsing Exp $ */ /* * Copyright (c) 2015 Joel Sing * Copyright (c) 2015 Bob Beck @@ -26,24 +26,24 @@ const char * tls_peer_cert_hash(struct tls *ctx) { - if (ctx->conninfo) - return (ctx->conninfo->hash); - return NULL; + if (ctx->conninfo == NULL) + return (NULL); + return (ctx->conninfo->hash); } const char * tls_peer_cert_issuer(struct tls *ctx) { - if (ctx->conninfo) - return (ctx->conninfo->issuer); - return NULL; + if (ctx->conninfo == NULL) + return (NULL); + return (ctx->conninfo->issuer); } const char * tls_peer_cert_subject(struct tls *ctx) { - if (ctx->conninfo) - return (ctx->conninfo->subject); - return NULL; + if (ctx->conninfo == NULL) + return (NULL); + return (ctx->conninfo->subject); } int