summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-24 23:42:29 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-24 23:42:29 +0200
commitcecd32f648cdf315ee19c0cf7c8c7cb9fb5d6ee6 (patch)
tree484fe3689c0d56fb225d64b7577424e983965eec /src/shared
parent72f1d5a2880d103dc1c1746f5c02e192e054705e (diff)
macro: increase VA_FORMAT_ADVANCE type array and hit assert when it is reached
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/macro.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 0dd210afa7..dbdf5b3fb0 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -193,10 +193,12 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
#define _cleanup_closedir_ __attribute__((cleanup(closedirp)))
#define _cleanup_umask_ __attribute__((cleanup(umaskp)))
-#define VA_FORMAT_ADVANCE(format, ap) do { \
- int _argtypes[64]; \
+#define VA_FORMAT_ADVANCE(format, ap) \
+do { \
+ int _argtypes[128]; \
size_t _i, _k; \
_k = parse_printf_format((format), ELEMENTSOF(_argtypes), _argtypes); \
+ assert(_k < ELEMENTSOF(_argtypes)); \
for (_i = 0; _i < _k; _i++) { \
if (_argtypes[_i] & PA_FLAG_PTR) { \
(void) va_arg(ap, void*); \