diff options
-rw-r--r-- | include/compat/err.h | 12 |
1 files 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 | |||
@@ -73,15 +73,21 @@ warn(const char *fmt, ...) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | static inline void | 75 | static inline void |
76 | vwarnx(const char *fmt, va_list args) | ||
77 | { | ||
78 | if (fmt != NULL) | ||
79 | vfprintf(stderr, fmt, args); | ||
80 | fprintf(stderr, "\n"); | ||
81 | } | ||
82 | |||
83 | static inline void | ||
76 | warnx(const char *fmt, ...) | 84 | warnx(const char *fmt, ...) |
77 | { | 85 | { |
78 | va_list ap; | 86 | va_list ap; |
79 | 87 | ||
80 | va_start(ap, fmt); | 88 | va_start(ap, fmt); |
81 | if (fmt != NULL) | 89 | vwarnx(fmt, ap); |
82 | vfprintf(stderr, fmt, ap); | ||
83 | va_end(ap); | 90 | va_end(ap); |
84 | fprintf(stderr, "\n"); | ||
85 | } | 91 | } |
86 | 92 | ||
87 | #endif | 93 | #endif |