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