diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-16 16:27:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-16 16:27:00 +0200 |
commit | b91a501fcd618a7f7a34e64cec9f74394fb0bad8 (patch) | |
tree | 7c1e487c66797d6a73c1a0cc55a73294896489e5 /src/basic/util.h | |
parent | ac2896bab61bd8cd0b8a8b92f8347e2c11a088b5 (diff) | |
parent | a8b626100b88b50c6c73fccf81b278d64e7e25a2 (diff) |
Merge pull request #1278 from michich/nicer-asserts
nicer assert messages
Diffstat (limited to 'src/basic/util.h')
-rw-r--r-- | src/basic/util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index c7dff9a86d..8abaa740b2 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -374,7 +374,9 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(cpu_set_t*, CPU_FREE); cpu_set_t* cpu_set_malloc(unsigned *ncpus); -#define xsprintf(buf, fmt, ...) assert_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf)) +#define xsprintf(buf, fmt, ...) \ + assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), \ + "xsprintf: " #buf "[] must be big enough") int files_same(const char *filea, const char *fileb); |