aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 1249997..515e4e4 100644
--- a/dwm.c
+++ b/dwm.c
@@ -395,7 +395,8 @@ arrange(Monitor *m)
void
arrangemon(Monitor *m)
{
- strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
+ strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof(m->ltsymbol) - 1);
+ m->ltsymbol[sizeof(m->ltsymbol) - 1] = '\0';
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
}
@@ -645,7 +646,8 @@ createmon(void)
m->topbar = topbar;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
+ strncpy(m->ltsymbol, layouts[0].symbol, sizeof(m->ltsymbol) - 1);
+ m->ltsymbol[sizeof(m->ltsymbol) - 1] = '\0';
return m;
}