diff options
author | zachir <zachir@librem.one> | 2022-01-26 23:55:16 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2022-01-26 23:55:16 -0600 |
commit | 061f5eebaaa639bff2e9b825322babc78831da9e (patch) | |
tree | d52ef939e2651fb4c165a7b9520b85b2c5f7b1e8 | |
parent | 7363955531bee115bfa13d792eccdcb2dc16519e (diff) |
fix dwm.c warnings about strncpy and pop()
-rw-r--r-- | dwm.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -231,7 +231,6 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); -static void pop(Client *); static Client *prevtiled(Client *c); static void propertynotify(XEvent *e); static void pushdown(const Arg *arg); @@ -485,7 +484,7 @@ 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); if (m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); } @@ -1564,15 +1563,6 @@ nexttiled(Client *c) return c; } -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - Client * prevtiled(Client *c) { Client *p, *r; @@ -2051,7 +2041,7 @@ setlayout(const Arg *arg) selmon->sellt ^= 1; if (arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol - 1); if (selmon->sel) arrange(selmon); else |