[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <C491DBC5-8891-4ED5-9869-A91A60978AFB@linux.dev>
Date: Mon, 11 Aug 2025 18:19:56 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Franco Martelli <martellif67@...il.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>,
Nicolas Schier <nicolas.schier@...ux.dev>,
Shankari Anand <shankari.ak0208@...il.com>,
"nir.tzachar@...il.com" <nir.tzachar@...il.com>,
Michal Marek <mmarek@...e.cz>,
stable@...r.kernel.org,
linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kconfig: nconf: NUL-terminate 'line' correctly in
fill_window()
On 11. Aug 2025, at 17:08, Thorsten Blum wrote:
> On 11. Aug 2025, at 14:51, Franco Martelli wrote:
>> Is there a rationale behind the choice to avoid to use snprintf()
>> in these circumstance?
>> Preferring snprintf() you will not have to take care to
>> compute the position of the NULL terminating character of the
>> string, it's done automatically by this function.
>
> I looked into it a bit more and I think we need neither strncpy() nor
> snprintf() (and no temporary buffer) because this should be sufficient:
>
> mvwprintw(win, i, 0, "%.*s", len, line);
>
> Unless I'm missing something, I'm happy to send a v2.
I submitted this as a new patch instead of a v2:
https://lore.kernel.org/lkml/20250811161650.37428-2-thorsten.blum@linux.dev/
Thanks,
Thorsten
Powered by blists - more mailing lists