From 513004a23dac3416f8f9c11aaa148bf8606c8617 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sun, 10 Apr 2016 19:33:58 +0000 Subject: libc: replace 0 with NULL for pointers. While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine) --- lib/libc/rpc/clnt_perror.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libc/rpc/clnt_perror.c') diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c index 15d72803df71c..d674fbb3847f8 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -64,8 +64,8 @@ static char * _buf(void) { - if (buf == 0) - buf = (char *)malloc(CLNT_PERROR_BUFLEN); + if (buf == NULL) + buf = malloc(CLNT_PERROR_BUFLEN); return (buf); } @@ -85,7 +85,7 @@ clnt_sperror(CLIENT *rpch, const char *s) assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return (0); len = CLNT_PERROR_BUFLEN; strstart = str; @@ -240,7 +240,7 @@ clnt_spcreateerror(const char *s) assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return(0); len = CLNT_PERROR_BUFLEN; i = snprintf(str, len, "%s: ", s); -- cgit v1.2.3