diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-20 16:47:05 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-20 16:47:05 +0000 |
| commit | c5031be4899ea516635ef7c65a6f82b3b45860b9 (patch) | |
| tree | 10948eb4aface28e80d6a075fecf11fad3075618 /xsnprintf.c | |
| parent | Merge branch 'decset-1047-and-1048' (diff) | |
| parent | debug: rename assert() to xassert(), to avoid clashing with <assert.h> (diff) | |
Merge branch 'stacktrace'
Diffstat (limited to 'xsnprintf.c')
| -rw-r--r-- | xsnprintf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xsnprintf.c b/xsnprintf.c index e8e8d25d..b0e17741 100644 --- a/xsnprintf.c +++ b/xsnprintf.c @@ -1,13 +1,13 @@ #include "xsnprintf.h" -#include <assert.h> #include <limits.h> #include <stdio.h> +#include "debug.h" size_t xvsnprintf(char *buf, size_t n, const char *format, va_list ap) { - assert(n <= INT_MAX); + xassert(n <= INT_MAX); int len = vsnprintf(buf, n, format, ap); /* @@ -19,8 +19,8 @@ xvsnprintf(char *buf, size_t n, const char *format, va_list ap) * has been completely written if and only if the returned value * is nonnegative and less than n." */ - assert(len >= 0); - assert(len < (int)n); + xassert(len >= 0); + xassert(len < (int)n); return (size_t)len; } |
