Code

xterm_title: pass string, no format
[ncmpc.git] / src / xterm_title.c
index fe03cfde11f80f8751978ea2332c0b24beffee96..0e993cf3b2d022f163103b787c2c4843f9d15e3f 100644 (file)
 #include "xterm_title.h"
 #include "options.h"
 
-#include <glib.h>
-
 #include <stdio.h>
 
 void
-set_xterm_title(const char *format, ...)
+set_xterm_title(const char *title)
 {
        /* the current xterm title exists under the WM_NAME property */
        /* and can be retrieved with xprop -id $WINDOWID */
 
        if (options.enable_xterm_title) {
                if (g_getenv("WINDOWID")) {
-                       va_list ap;
-                       va_start(ap,format);
-                       char *msg = g_strdup_vprintf(format,ap);
-                       va_end(ap);
-                       printf("\033]0;%s\033\\", msg);
+                       printf("\033]0;%s\033\\", title);
                        fflush(stdout);
-                       g_free(msg);
                } else
                        options.enable_xterm_title = FALSE;
        }