aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2022-03-16 04:21:18 -0500
committerBrent Cook <busterb@gmail.com>2022-03-16 04:21:52 -0500
commitf6deadbec9bd455ef1851da07ab7ecd401a92d6d (patch)
tree1e3af3cfc2db20e6c6205798add3c37f125db00c /include
parent15d1f01e0f36228c501584c858697203b34e835d (diff)
downloadportable-f6deadbec9bd455ef1851da07ab7ecd401a92d6d.tar.gz
portable-f6deadbec9bd455ef1851da07ab7ecd401a92d6d.tar.bz2
portable-f6deadbec9bd455ef1851da07ab7ecd401a92d6d.zip
add vwarnx
Diffstat (limited to 'include')
-rw-r--r--include/compat/err.h12
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
75static inline void 75static inline void
76vwarnx(const char *fmt, va_list args)
77{
78 if (fmt != NULL)
79 vfprintf(stderr, fmt, args);
80 fprintf(stderr, "\n");
81}
82
83static inline void
76warnx(const char *fmt, ...) 84warnx(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