]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Allow failure(NULL) to clear the failure detail message.
authorTim Kientzle <kientzle@gmail.com>
Sun, 31 Oct 2010 06:26:15 +0000 (02:26 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 31 Oct 2010 06:26:15 +0000 (02:26 -0400)
SVN-Revision: 2774

libarchive/test/main.c

index d89eb396e2bc6c618c8ef56d77eca4a6fec99a3b..cabcb2868a21fe46668c7ea1e5e20a38fcae5128 100644 (file)
@@ -237,10 +237,14 @@ void
 failure(const char *fmt, ...)
 {
        va_list ap;
-       va_start(ap, fmt);
-       vsprintf(msgbuff, fmt, ap);
-       va_end(ap);
-       nextmsg = msgbuff;
+       if (fmt == NULL) {
+               nextmsg = NULL;
+       } else {
+               va_start(ap, fmt);
+               vsprintf(msgbuff, fmt, ap);
+               va_end(ap);
+               nextmsg = msgbuff;
+       }
 }
 
 /*