aboutsummaryrefslogtreecommitdiffstats
path: root/src/wins.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-03-02 09:28:13 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-03-12 20:36:22 +0100
commit481cb5524f8e165bbe3c17bb04bdc7330dd7a923 (patch)
tree34c4c09613e40c82a9bab4b15685cad949d7ce1c /src/wins.c
parent0f4b45e62487e32e789571912fd2190168f753bc (diff)
downloadcalcurse-481cb5524f8e165bbe3c17bb04bdc7330dd7a923.tar.gz
calcurse-481cb5524f8e165bbe3c17bb04bdc7330dd7a923.zip
Do not strncpy() strings returned by gettext()
Translated strings returned by gettext() are statically allocated. There's no need to copy them to a buffer, we can use the pointers returned by gettext() instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/wins.c')
-rw-r--r--src/wins.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/wins.c b/src/wins.c
index fa53dcb..6c74d0f 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -224,21 +224,16 @@ wins_slctd_next (void)
static void
wins_init_panels (void)
{
- char label[BUFSIZ];
-
win[CAL].p = newwin (CALHEIGHT, wins_sbar_width (), win[CAL].y, win[CAL].x);
- strncpy (label, _("Calendar"), BUFSIZ);
- wins_show (win[CAL].p, label);
+ wins_show (win[CAL].p, _("Calendar"));
win[APP].p = newwin (win[APP].h, win[APP].w, win[APP].y, win[APP].x);
- strncpy (label, _("Appointments"), BUFSIZ);
- wins_show (win[APP].p, label);
+ wins_show (win[APP].p, _("Appointments"));
apad.width = win[APP].w - 3;
apad.ptrwin = newpad (apad.length, apad.width);
win[TOD].p = newwin (win[TOD].h, win[TOD].w, win[TOD].y, win[TOD].x);
- strncpy (label, _("ToDo"), BUFSIZ);
- wins_show (win[TOD].p, label);
+ wins_show (win[TOD].p, _("ToDo"));
/* Enable function keys (i.e. arrow keys) in those windows */
keypad (win[CAL].p, TRUE);
@@ -353,7 +348,7 @@ wins_reinit (void)
/* Show the window with a border and a label. */
void
-wins_show (WINDOW *win, char *label)
+wins_show (WINDOW *win, const char *label)
{
int width = getmaxx (win);