summaryrefslogtreecommitdiff
path: root/src/help.c
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-31 18:11:53 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-31 20:27:43 +0200
commit4c4d4d3eb3fd2bdeefb034a524f02b803f4583ab (patch)
tree94b27921dcd22e6b28fb7ba1a25c2a76019bf13d /src/help.c
parentbc7c0be84c31633f1b4903b8ae623f5c1cb9395e (diff)
downloadcalcurse-4c4d4d3eb3fd2bdeefb034a524f02b803f4583ab.zip
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 <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/help.c b/src/help.c
index 6dbac96..69bb79d 100644
--- a/src/help.c
+++ b/src/help.c
@@ -103,7 +103,7 @@ help_write_pad(struct window *win, char *title, char *text, enum key action)
rownum = 0;
erase_window_part(win->p, rownum, colnum, BUFSIZ, win->w);
custom_apply_attr(win->p, ATTR_HIGHEST);
- mvwprintw(win->p, rownum, colnum, "%s", title);
+ mvwaddstr(win->p, rownum, colnum, title);
if ((int)action != KEY_RESIZE && action < NBKEYS) {
switch (action) {
case KEY_END_OF_WEEK:
@@ -137,7 +137,7 @@ help_write_pad(struct window *win, char *title, char *text, enum key action)
colnum = 0;
rownum += get_help_lines(title);
custom_remove_attr(win->p, ATTR_HIGHEST);
- mvwprintw(win->p, rownum, colnum, "%s", text);
+ mvwaddstr(win->p, rownum, colnum, text);
rownum += get_help_lines(text);
return rownum;
}