mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "yang.yang29@zte.com.cn" <yang.yang29@zte.com.cn>,
	"bp@alien8.de" <bp@alien8.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xu.panda@zte.com.cn" <xu.panda@zte.com.cn>
Subject: Re: [PATCH linux-next] x86/mce/dev-mcelog: use strscpy() to instead of strncpy()
Date: Wed, 14 Dec 2022 14:54:02 -0800	[thread overview]
Message-ID: <20221214225402.GA16409@ranerica-svr.sc.intel.com> (raw)
In-Reply-To: <SJ1PR11MB60831C20F1A68163E04D742CFCE09@SJ1PR11MB6083.namprd11.prod.outlook.com>

On Wed, Dec 14, 2022 at 09:29:59PM +0000, Luck, Tony wrote:
> >> The implementation of strscpy() is more robust and safer.
> >> That's now the recommended way to copy NUL terminated strings.
> >
> > It should read "NULL-terminated strings".
> 
> Both "NUL-terminated" and "NULL-terminated" seem to be used in the kernel
> source and commit comments.  NULL is ahead 124:45 in the source, but it
> is closer in the commit logs where the ratio is 129:76.
> 
> Single "L" NUL seems technically more accurate as the string terminator is
> an ascii NUL character. From man 5 ascii the character name is NUL (though
> the description says "null" to muddy the waters)
> 
>        Oct   Dec   Hex   Char
>        ───────────────────────────────────────────
>        000   0     00    NUL '\0' (null character)

Thanks for the analysis Tony. Indeed, I agree that "NUL-terminated" is
more accurate.

Thanks and BR,
Ricardo

  reply	other threads:[~2022-12-14 22:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03  6:19 yang.yang29
2022-12-03 22:21 ` Luck, Tony
2022-12-14 20:54 ` Ricardo Neri
2022-12-14 21:29   ` Luck, Tony
2022-12-14 22:54     ` Ricardo Neri [this message]
2023-01-07 11:37 ` [tip: x86/platform] " tip-bot2 for Xu Panda

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=20221214225402.GA16409@ranerica-svr.sc.intel.com \
    --to=ricardo.neri-calderon@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xu.panda@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®