Re: [hackers] [dwm][PATCH] Add ' - 1' to size arg to avoid warnings with -O2

From: sulevedant=gmail.com <Vedant>
Date: Wed, 28 Oct 2026 17:04:00 +0000

Steve Ward (planet36=gmail.com) via suckless hackers list wrote:
>
> Should a similar change be made in `setlayout`?
> https://git.suckless.org/dwm/file/dwm.c.html#l1523
>

I thought I'd already sent another reply with this but checking
lists.suckless.org it seems like it didn't go through. Here's the reply
I wanted to send to Hiltjo:

> Hiltjo Posthuma (hiltjo=codemadness.org) via suckless hackers list wrote:
>> Thanks for the patch, it has recently been fixed already:
>> https://git.suckless.org/dwm/commit/ce41d3479103fe818466cde9394cce9ac314f519.html
>>
>> (Theres not a new dwm release for it yet though)
>>
>
> Ah whoops, I'd originally meant to send the two patches earlier but obviously there were the issues with the mailing list, and I forgot to git pull before resending the patches. I'll edit the other patch so it can merge with head of the repo.
>
>>> _at_@ -642,7 +642,7 @@ 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);
>>> return m;
>>> }
>
> However, I noticed that this part wasn't included in the commit. Would it be worth adding for consistency's sake?
>
> Sorry for the double email, I accidentally clicked Send before I'd finished writing it.
Received on Wed Oct 28 2026 - 18:04:00 CET

This archive was generated by hypermail 2.3.0 : Wed Oct 28 2026 - 21:00:48 CET