From b62f008974c96e0302d6c146cf49bc2045bef005 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 13 Nov 1998 02:07:07 +0000 Subject: include/smb.h: Re-added zero pointer protection to ZERO_STRUCTP. lib/util_sock.c: Added strerror() calls to getpeername failures (which seem to be giving IRIX trouble at the moment). rpc_parse/parse_sec.c: Changed use of ZERO_STRUCTPN to ZERO_STRUCTP which again does zero pointer protection. smbd/quotas.c: Fixed typo. Jeremy. --- source/include/smb.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/include/smb.h') diff --git a/source/include/smb.h b/source/include/smb.h index 9339cdda6f0..bb055214ec5 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1655,9 +1655,7 @@ extern int unix_ERR_code; #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) /* zero a structure given a pointer to the structure */ -#define ZERO_STRUCTP(x) { memset((char *)(x), 0, sizeof(*(x))); } - -#define ZERO_STRUCTPN(x) { if (x != NULL) ZERO_STRUCTP(x); } +#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } /* zero an array - note that sizeof(array) must work - ie. it must not be a pointer */ -- cgit