diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-13 17:26:44 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-13 17:26:44 +0000 |
commit | 0be34ca1402f95506680caa3461e94d4ae54bb7d (patch) | |
tree | c918e92539f62e8304a5f1815fa374245a579a3e /source/include | |
parent | 5be3c37f50eac35cad3eadf0d24e7a4ee04c075e (diff) | |
download | samba-0be34ca1402f95506680caa3461e94d4ae54bb7d.tar.gz samba-0be34ca1402f95506680caa3461e94d4ae54bb7d.tar.xz samba-0be34ca1402f95506680caa3461e94d4ae54bb7d.zip |
ZERO_STRUCTP does not check argument for NULL.
ZERO_STRUCTPN _does_ check argument for NULL.
Diffstat (limited to 'source/include')
-rw-r--r-- | source/include/smb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/include/smb.h b/source/include/smb.h index bb055214ec5..acbd56d81e1 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1655,7 +1655,10 @@ 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) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } +#define ZERO_STRUCTP(x) memset((char *)(x), 0, sizeof(*(x)) + +/* zero a structure given a pointer to the structure */ +#define ZERO_STRUCTPN(x) { if ((x) != NULL) ZERO_STRUCTP(x); } /* zero an array - note that sizeof(array) must work - ie. it must not be a pointer */ |