From f6deadbec9bd455ef1851da07ab7ecd401a92d6d Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 16 Mar 2022 04:21:18 -0500 Subject: add vwarnx --- include/compat/err.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/compat/err.h b/include/compat/err.h index 8b5b635..945a75d 100644 --- a/include/compat/err.h +++ b/include/compat/err.h @@ -72,16 +72,22 @@ warn(const char *fmt, ...) fprintf(stderr, "%s\n", strerror(sverrno)); } +static inline void +vwarnx(const char *fmt, va_list args) +{ + if (fmt != NULL) + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); +} + static inline void warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - if (fmt != NULL) - vfprintf(stderr, fmt, ap); + vwarnx(fmt, ap); va_end(ap); - fprintf(stderr, "\n"); } #endif -- cgit v1.2.3-55-g6feb