aboutsummaryrefslogtreecommitdiffstats
path: root/src/io.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/io.c
parentbc7c0be84c31633f1b4903b8ae623f5c1cb9395e (diff)
downloadcalcurse-4c4d4d3eb3fd2bdeefb034a524f02b803f4583ab.tar.gz
calcurse-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/io.c')
-rw-r--r--src/io.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/io.c b/src/io.c
index fdead34..9bffe1a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -134,8 +134,8 @@ static void progress_bar(progress_bar_t type, int progress)
}
/* Draw the progress bar. */
- mvwprintw(win[STA].p, 1, ipos, barchar);
- mvwprintw(win[STA].p, 1, epos[steps - 1], barchar);
+ mvwaddstr(win[STA].p, 1, ipos, barchar);
+ mvwaddstr(win[STA].p, 1, epos[steps - 1], barchar);
custom_apply_attr(win[STA].p, ATTR_HIGHEST);
for (i = ipos + 1; i < epos[progress]; i++)
mvwaddch(win[STA].p, 1, i, ' ' | A_REVERSE);
@@ -310,10 +310,10 @@ static void display_mark(void)
mwin = newwin(1, 2, 1, col - 3);
custom_apply_attr(mwin, ATTR_HIGHEST);
- mvwprintw(mwin, 0, 0, "**");
+ mvwaddstr(mwin, 0, 0, "**");
wins_wrefresh(mwin);
sleep(DISPLAY_TIME);
- mvwprintw(mwin, 0, 0, " ");
+ mvwaddstr(mwin, 0, 0, " ");
wins_wrefresh(mwin);
delwin(mwin);
wins_doupdate();
@@ -942,14 +942,14 @@ void io_export_bar(void)
spc = 15;
custom_apply_attr(win[STA].p, ATTR_HIGHEST);
- mvwprintw(win[STA].p, 0, 2, "Q");
- mvwprintw(win[STA].p, 1, 2, "I");
- mvwprintw(win[STA].p, 0, 2 + spc, "P");
+ mvwaddstr(win[STA].p, 0, 2, "Q");
+ mvwaddstr(win[STA].p, 1, 2, "I");
+ mvwaddstr(win[STA].p, 0, 2 + spc, "P");
custom_remove_attr(win[STA].p, ATTR_HIGHEST);
- mvwprintw(win[STA].p, 0, 2 + smlspc, _("Exit"));
- mvwprintw(win[STA].p, 1, 2 + smlspc, _("Ical"));
- mvwprintw(win[STA].p, 0, 2 + spc + smlspc, _("Pcal"));
+ mvwaddstr(win[STA].p, 0, 2 + smlspc, _("Exit"));
+ mvwaddstr(win[STA].p, 1, 2 + smlspc, _("Ical"));
+ mvwaddstr(win[STA].p, 0, 2 + spc + smlspc, _("Pcal"));
wnoutrefresh(win[STA].p);
wmove(win[STA].p, 0, 0);