From 4c4d4d3eb3fd2bdeefb034a524f02b803f4583ab Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Thu, 31 May 2012 18:11:53 +0200 Subject: Use mvwaddstr() instead of mvwprintw() When we only want to display a string at a specific place of the screen, there's no need to use the more complex mvwprintw(), use mvwaddstr() instead. This should be slightly more efficient, and, above all, it prevents weird things to happen if our string contains a '%', being interpreted as an unwanted format string. Signed-off-by: Baptiste Jonglez Signed-off-by: Lukas Fleischer --- src/notify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/notify.c') diff --git a/src/notify.c b/src/notify.c index ffd32dd..a057c2f 100644 --- a/src/notify.c +++ b/src/notify.c @@ -543,7 +543,7 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name, maxlen = MAXCOL - x_opt - 2; custom_apply_attr(win, ATTR_HIGHEST); if (len < maxlen) - mvwprintw(win, y, x_opt, "%s", valstr); + mvwaddstr(win, y, x_opt, valstr); else { char buf[BUFSIZ]; @@ -554,7 +554,7 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name, custom_remove_attr(win, ATTR_HIGHEST); } else print_bool_option_incolor(win, valbool, y, x_opt); - mvwprintw(win, y + 1, x, desc); + mvwaddstr(win, y + 1, x, desc); } /* Print options related to the notify-bar. */ -- cgit v1.2.3-54-g00ecf