summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-11-04 12:04:55 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-11-04 12:04:55 -0500
commit9e15e076c1f3e647b1f7ed7e3c12a1f23fdbe98c (patch)
treeac3c1e11ce7e4a7a1fd53459b3e0e4f9e2892188 /printf.c
parent726d78019593d5b5f192d2962f5bc975bfe85785 (diff)
downloadbfs-9e15e076c1f3e647b1f7ed7e3c12a1f23fdbe98c.tar.xz
Enable -Wsign-compare to catch bugs like 726d7801
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/printf.c b/printf.c
index 003c1b0..e07feb4 100644
--- a/printf.c
+++ b/printf.c
@@ -73,7 +73,7 @@ static int bfs_printf_flush(FILE *file, const struct bfs_printf *directive, cons
#define BFS_PRINTF_BUF(buf, format, ...) \
char buf[256]; \
int ret = snprintf(buf, sizeof(buf), format, __VA_ARGS__); \
- assert(ret >= 0 && ret < sizeof(buf)); \
+ assert(ret >= 0 && (size_t)ret < sizeof(buf)); \
(void)ret
/** %a, %c, %t: ctime() */
@@ -172,7 +172,7 @@ static int bfs_printf_strftime(FILE *file, const struct bfs_printf *directive, c
break;
}
- assert(ret >= 0 && ret < sizeof(buf));
+ assert(ret >= 0 && (size_t)ret < sizeof(buf));
(void)ret;
return fprintf(file, directive->str, buf);