On Fri, Aug 11, 2017 at 5:07 AM, Antonio Quartulli <a...@unstable.cc> wrote:

> From: Antonio Quartulli <anto...@openvpn.net>
>
> Signed-off-by: Antonio Quartulli <anto...@openvpn.net>
> ---
>  src/openvpn/ps.c                 | 2 +-
>  src/openvpn/ssl_openssl.c        | 2 +-
>  src/openvpn/ssl_verify_openssl.c | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c
> index 45e24ded..5136a20c 100644
> --- a/src/openvpn/ps.c
> +++ b/src/openvpn/ps.c
> @@ -922,7 +922,7 @@ port_share_open(const char *host,
>          openvpn_close_socket(fd[1]);
>
>          exit(0);
> -        return 0; /* NOTREACHED */
> +        return NULL; /* NOTREACHED */

     }
>
>  error:
> diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
> index fa06f068..c977b9e2 100644
> --- a/src/openvpn/ssl_openssl.c
> +++ b/src/openvpn/ssl_openssl.c
> @@ -703,7 +703,7 @@ tls_ctx_add_extra_certs(struct tls_root_ctx *ctx, BIO
> *bio)
>      for (;; )
>      {
>          cert = NULL;
> -        if (!PEM_read_bio_X509(bio, &cert, 0, NULL)) /* takes ownership
> of cert */
> +        if (!PEM_read_bio_X509(bio, &cert, NULL, NULL)) /* takes
> ownership of cert */
>          {
>              break;
>          }
> diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_
> openssl.c
> index ea474955..2f3b10b9 100644
> --- a/src/openvpn/ssl_verify_openssl.c
> +++ b/src/openvpn/ssl_verify_openssl.c
> @@ -202,8 +202,8 @@ extract_x509_field_ssl(X509_NAME *x509, const char
> *field_name, char *out,
>  {
>      int lastpos = -1;
>      int tmp = -1;
> -    X509_NAME_ENTRY *x509ne = 0;
> -    ASN1_STRING *asn1 = 0;
> +    X509_NAME_ENTRY *x509ne = NULL;
> +    ASN1_STRING *asn1 = NULL;
>


Constant 0 or (void *) 0 assigned to a pointer are the same as NULL
pointer, so why bother?

int *a = 0; is perfectly valid in my view.

Of course,
int i = 0; int *a = i;
would be bad style and error-prone, and the compiler would warn, but not
the use of literal 0.

Selva
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to