summaryrefslogtreecommitdiffstats
path: root/diag.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-03-13 16:26:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-03-15 12:48:33 -0400
commit56a862fded43b528eadc232d37a8684b48ef702c (patch)
tree2ee0b7417a8f16de396808aac7c7257e4b94f061 /diag.c
parent09558efdf0af09db73a4d16039a1e2718e7a58c5 (diff)
downloadbfs-56a862fded43b528eadc232d37a8684b48ef702c.tar.xz
diag: Make the -warn flag part of the cmdline
Diffstat (limited to 'diag.c')
-rw-r--r--diag.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/diag.c b/diag.c
index bdbf98e..f43ed2e 100644
--- a/diag.c
+++ b/diag.c
@@ -47,12 +47,14 @@ void bfs_verror(const struct cmdline *cmdline, const char *format, va_list args)
}
void bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args) {
- int error = errno;
+ if (cmdline->warn) {
+ int error = errno;
- bfs_warning_prefix(cmdline);
+ bfs_warning_prefix(cmdline);
- errno = error;
- cvfprintf(cmdline->cerr, format, args);
+ errno = error;
+ cvfprintf(cmdline->cerr, format, args);
+ }
}
void bfs_error_prefix(const struct cmdline *cmdline) {