summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-12-03 15:32:55 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-04-30 23:18:26 +0000
commit9d1d44dcb72f24aa078dd050da0c7c1aecd3513e (patch)
tree95fe2b803abfafd1b1711f4972a325913db079ab /lib
parent4f2af93a7fc736f2ef3dfe0dbc8bf8c3a2eb4161 (diff)
downloadsamba-9d1d44dcb72f24aa078dd050da0c7c1aecd3513e.tar.gz
replace: Add ZERO_ARRAY_LEN() macro
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/replace.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 212ed265d4a..1658465866e 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -837,6 +837,11 @@ typedef unsigned long long ptrdiff_t ;
#define ZERO_ARRAY(x) memset_s((char *)(x), sizeof(x), 0, sizeof(x))
/**
+ * Zero a given len of an array
+ */
+#define ZERO_ARRAY_LEN(x, l) memset_s((char *)(x), (l), 0, (l))
+
+/**
* Work out how many elements there are in a static array.
*/
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))