summaryrefslogtreecommitdiffstats
path: root/src/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-05-18 16:44:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-05-18 16:46:13 -0400
commit526133c11eb9a26a4cffb20bcd10bcbb36d940de (patch)
tree26787e3cc22df2c44837f72f6ff919ab7808a8f6 /src/printf.c
parent63a52b1bfc99c58f0a944174282da79aab5bde3a (diff)
downloadbfs-526133c11eb9a26a4cffb20bcd10bcbb36d940de.tar.xz
Switch from assert() to bfs_assert()/bfs_verify()
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c
index 9ccc216..6520d2d 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -16,7 +16,6 @@
#include "pwcache.h"
#include "stat.h"
#include "xtime.h"
-#include <assert.h>
#include <errno.h>
#include <grp.h>
#include <pwd.h>
@@ -74,7 +73,7 @@ static bool should_color(CFILE *cfile, const struct bfs_printf *directive) {
#define BFS_PRINTF_BUF(buf, format, ...) \
char buf[256]; \
int ret = snprintf(buf, sizeof(buf), format, __VA_ARGS__); \
- assert(ret >= 0 && (size_t)ret < sizeof(buf)); \
+ bfs_assert(ret >= 0 && (size_t)ret < sizeof(buf)); \
(void)ret
/**
@@ -190,7 +189,7 @@ static int bfs_printf_strftime(CFILE *cfile, const struct bfs_printf *directive,
break;
}
- assert(ret >= 0 && (size_t)ret < sizeof(buf));
+ bfs_assert(ret >= 0 && (size_t)ret < sizeof(buf));
(void)ret;
return dyn_fprintf(cfile->file, directive, buf);