public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: Roel Kluin <roel.kluin@gmail•com>
Cc: linuxppc-dev@ozlabs•org,
	Andrew Morton <akpm@linux-foundation•org>,
	cbe-oss-dev@ozlabs•org
Subject: Re: [PATCH] powerpc/cell: strncpy does not null terminate string
Date: Fri, 17 Jul 2009 17:56:21 +0200	[thread overview]
Message-ID: <200907171756.22224.arnd@arndb.de> (raw)
In-Reply-To: <4A608A69.4060204@gmail.com>

On Friday 17 July 2009, Roel Kluin wrote:
> 
>  static int __init celleb_machine_type_hack(char *ptr)
>  {
> -       strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
> +       strlcpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
>         celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
>         return 0;

This still is pointless as long as you keep the explicit null-termination
in the next line, the patch still doesn't change anything significant.

The file is maintained by Ishizaki Kou, if he would prefer to take a
patch replacing the two lines with one, that's fine with me, otherwise
I just wouldn't bother. You still only gain a few bytes of inittext, but
that is discarded at boot time.

	Arnd <><

  reply	other threads:[~2009-07-17 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 12:41 [PATCH] powerpc/cell: strncpy does not null terminate string Roel Kluin
2009-07-17 14:27 ` Roel Kluin
2009-07-17 15:56   ` Arnd Bergmann [this message]
2009-07-21  9:31     ` Ken Kawakami
2009-07-17 15:05 ` Arnd Bergmann
2009-07-17 15:19   ` roel kluin
2009-07-21 10:17 ` [PATCH] powerpc/cell: replace strncpy by strlcpy Roel Kluin
2009-07-22  4:22   ` Ken Kawakami

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=200907171756.22224.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=cbe-oss-dev@ozlabs$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=roel.kluin@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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