From: Max Kellermann Date: Mon, 20 Mar 2017 16:02:00 +0000 (+0100) Subject: xterm_title: pass string, no format X-Git-Tag: v0.27~41 X-Git-Url: https://git.tokkee.org/?p=ncmpc.git;a=commitdiff_plain;h=13e870230c604adf01e6f409a53231febe14d2c0 xterm_title: pass string, no format --- diff --git a/src/main.c b/src/main.c index d4c5168..b67165f 100644 --- a/src/main.c +++ b/src/main.c @@ -83,7 +83,7 @@ update_xterm_title(void) static char title[BUFSIZE]; if (strncmp(title, tmp, BUFSIZE)) { g_strlcpy(title, tmp, BUFSIZE); - set_xterm_title("%s", title); + set_xterm_title(title); } } #endif diff --git a/src/xterm_title.c b/src/xterm_title.c index fe03cfd..0e993cf 100644 --- a/src/xterm_title.c +++ b/src/xterm_title.c @@ -20,25 +20,18 @@ #include "xterm_title.h" #include "options.h" -#include - #include 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; } diff --git a/src/xterm_title.h b/src/xterm_title.h index 28addd5..d850f5c 100644 --- a/src/xterm_title.h +++ b/src/xterm_title.h @@ -21,6 +21,6 @@ #define XTERM_TITLE_H void -set_xterm_title(const char *format, ...); +set_xterm_title(const char *title); #endif