summaryrefslogtreecommitdiff
path: root/source3/include/smb.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include/smb.h')
-rw-r--r--source3/include/smb.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index bb055214ec..e94d45bf07 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1654,8 +1654,11 @@ extern int unix_ERR_code;
/* zero a structure */
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+/* zero a structure given a pointer to the structure - no zero check */
+#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
+
/* zero a structure given a pointer to the structure */
-#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
+#define ZERO_STRUCTP(x) { if ((x) != NULL) ZERO_STRUCTPN(x); }
/* zero an array - note that sizeof(array) must work - ie. it must not be a
pointer */