All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Franco Martelli <martellif67@gmail.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Nicolas Schier <nicolas.schier@linux.dev>,
	Shankari Anand <shankari.ak0208@gmail.com>,
	"nir.tzachar@gmail.com" <nir.tzachar@gmail.com>,
	Michal Marek <mmarek@suse.cz>,
	stable@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: nconf: NUL-terminate 'line' correctly in fill_window()
Date: Mon, 11 Aug 2025 18:19:56 +0200	[thread overview]
Message-ID: <C491DBC5-8891-4ED5-9869-A91A60978AFB@linux.dev> (raw)
In-Reply-To: <4B3C8558-81F3-4965-A09C-CE07D6A5FF4A@linux.dev>

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


      reply	other threads:[~2025-08-11 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 14:22 [PATCH] kconfig: nconf: NUL-terminate 'line' correctly in fill_window() Thorsten Blum
2025-08-11  0:19 ` Randy Dunlap
2025-08-11 12:51 ` Franco Martelli
2025-08-11 15:08   ` Thorsten Blum
2025-08-11 16:19     ` Thorsten Blum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C491DBC5-8891-4ED5-9869-A91A60978AFB@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martellif67@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=mmarek@suse.cz \
    --cc=nicolas.schier@linux.dev \
    --cc=nir.tzachar@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=shankari.ak0208@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.