Explorar o código

handle null arguments to legacy bsd err.h functions

Rich Felker %!s(int64=12) %!d(string=hai) anos
pai
achega
dc82ee4e30
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/linux/err.c

+ 2 - 2
src/linux/err.c

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