summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index ad9753655a..b33fdb5b7a 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -657,3 +657,11 @@ static inline unsigned decimal_str_max(unsigned x) {
}
int unlink_noerrno(const char *path);
+
+#define alloca0(n) \
+ ({ \
+ char *__new; \
+ size_t __len = n; \
+ __new = alloca(__len); \
+ (void *) memset(__new, 0, __len); \
+ })