handle null arguments to legacy bsd err.h functions

This commit is contained in:
Rich Felker 2012-08-15 22:35:02 -04:00
parent 3f80afc505
commit dc82ee4e30

View File

@ -5,13 +5,13 @@
void vwarn(const char *fmt, va_list ap) void vwarn(const char *fmt, va_list ap)
{ {
vfprintf(stderr, fmt, ap); if (fmt) vfprintf(stderr, fmt, ap);
perror(""); perror("");
} }
void vwarnx(const char *fmt, va_list ap) void vwarnx(const char *fmt, va_list ap)
{ {
vfprintf(stderr, fmt, ap); if (fmt) vfprintf(stderr, fmt, ap);
putc('\n', stderr); putc('\n', stderr);
} }