]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix con_vprintmsg madness
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 18:19:30 +0000 (19:19 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 18:19:30 +0000 (19:19 +0100)
con.c

diff --git a/con.c b/con.c
index 8073a5723d71286568e5d0c164d3e34059af924f..a46a7500b4b76e14b10dd6015e1db9e064614db1 100644 (file)
--- a/con.c
+++ b/con.c
@@ -328,18 +328,19 @@ void con_vprintmsg(int level, const char *name, size_t line, const char *msgtype
         CON_CYAN,
         CON_RED
     };
-    
-    int  err                        = !!(level == LVL_ERROR);
-    int  color                      = (err) ? console.color_err : console.color_out;
-    int (*print)(const char *, ...) = (err) ? &con_err          : &con_out;
-    
+
+    int  err                         = !!(level == LVL_ERROR);
+    int  color                       = (err) ? console.color_err : console.color_out;
+    int (*print)(const char *, ...)  = (err) ? &con_err          : &con_out;
+    int (*vprint)(const char *, va_list) = (err) ? &con_verr : &con_vout;
+
     if (color)
         print("\033[0;%dm%s:%d: \033[0;%dm%s: \033[0m", CON_CYAN, name, (int)line, sel[level], msgtype);
     else
         print("%s:%d: %s: ", name, (int)line, msgtype);
-        
-    con_verr(msg, ap);
-    fprintf (stderr, "\n");
+
+    vprint(msg, ap);
+    print("\n");
 }
 
 void con_printmsg(int level, const char *name, size_t line, const char *msgtype, const char *msg, ...) {