From ed5c5dbde1575d74c87ae9856fe61268d7ae8f4b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 14 Apr 2013 17:43:59 +0200 Subject: util: introduce alloca0() and use it at a number of places --- src/shared/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/shared/util.h') 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); \ + }) -- cgit v1.2.3-54-g00ecf