Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758938AbYCGIPI (ORCPT ); Fri, 7 Mar 2008 03:15:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754047AbYCGIO4 (ORCPT ); Fri, 7 Mar 2008 03:14:56 -0500 Received: from imx9.toshiba.co.jp ([202.33.96.51]:61095 "EHLO imx9.toshiba.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752535AbYCGIOz (ORCPT ); Fri, 7 Mar 2008 03:14:55 -0500 Date: Fri, 07 Mar 2008 17:06:19 +0900 (JST) Message-Id: <20080307.170619.-1300529804.kouish@swc.toshiba.co.jp> To: paulus@samba.org Cc: 12o3l@tiscali.nl, arnd@arndb.de, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PPC: in celleb_show_cpuinfo() convert strncpy(x, y, sizeof(x)) to strlcpy In-Reply-To: <47CFEF82.10709@tiscali.nl> From: Ishizaki Kou X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1450 Lines: 39 Roel Kluin <12o3l@tiscali.nl> wrote: > Roel Kluin wrote: > > This patch was not yet tested. Please confirm it's right. > > was too quick with the send button. the batch below is probably better > --- > strncpy does not append '\0' if the length of the source string equals > the size parameter, strlcpy does. > > Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Kou Ishizaki I tested Roel's 2nd patch and it works good on Celleb. > --- > diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c > index f27ae1e..cbe09d9 100644 > --- a/arch/powerpc/platforms/celleb/setup.c > +++ b/arch/powerpc/platforms/celleb/setup.c > @@ -81,8 +81,7 @@ static void celleb_show_cpuinfo(struct seq_file *m) > > static int __init celleb_machine_type_hack(char *ptr) > { > - strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); > - celleb_machine_type[sizeof(celleb_machine_type)-1] = 0; > + strlcpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); > return 0; > } > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/