From 8a0f61568f57d55442e134c5d90955e3509eca43 Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 17 Sep 1999 00:21:12 +0000 Subject: [PATCH] since clnt_p*error() are expected to print an error message, print one if they're called with dodgy args. ;) --- lib/libc/rpc/clnt_perror.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c index ffc1c2510b72..5b8369a70516 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -1,4 +1,4 @@ -/* $NetBSD: clnt_perror.c,v 1.18 1999/09/16 11:45:22 lukem Exp $ */ +/* $NetBSD: clnt_perror.c,v 1.19 1999/09/17 00:21:12 lukem Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,7 +35,7 @@ static char *sccsid = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)clnt_perror.c 2.1 88/07/29 4.0 RPCSRC"; #else -__RCSID("$NetBSD: clnt_perror.c,v 1.18 1999/09/16 11:45:22 lukem Exp $"); +__RCSID("$NetBSD: clnt_perror.c,v 1.19 1999/09/17 00:21:12 lukem Exp $"); #endif #endif @@ -189,8 +189,11 @@ clnt_perror(rpch, s) _DIAGASSERT(rpch != NULL); _DIAGASSERT(s != NULL); #ifdef _DIAGNOSTIC - if (rpch == NULL || s == NULL) + if (rpch == NULL || s == NULL) { + (void) fprintf(stderr, + "ERROR: clnt_perror() called with NULL argument\n"); return; + } #endif (void) fprintf(stderr, "%s\n", clnt_sperror(rpch,s)); @@ -302,8 +305,11 @@ clnt_pcreateerror(s) _DIAGASSERT(s != NULL); #ifdef _DIAGNOSTIC - if (s == NULL) + if (s == NULL) { + (void) fprintf(stderr, + "ERROR: clnt_pcreateerror() called with NULL argument\n"); return; + } #endif (void) fprintf(stderr, "%s\n", clnt_spcreateerror(s));