From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UNS4B-0003vQ-K4 for mharc-grub-devel@gnu.org; Wed, 03 Apr 2013 14:05:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNS47-0003v6-G1 for grub-devel@gnu.org; Wed, 03 Apr 2013 14:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNS45-0003HY-JM for grub-devel@gnu.org; Wed, 03 Apr 2013 14:05:43 -0400 Received: from mail.csclub.uwaterloo.ca ([129.97.134.52]:47621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNS45-0003HP-Ff for grub-devel@gnu.org; Wed, 03 Apr 2013 14:05:41 -0400 Received: from caffeine.csclub.uwaterloo.ca (caffeine.csclub.uwaterloo.ca [129.97.134.17]) by mail.csclub.uwaterloo.ca (Postfix) with SMTP id 396EF23BEE for ; Wed, 3 Apr 2013 14:05:39 -0400 (EDT) Received: by caffeine.csclub.uwaterloo.ca (sSMTP sendmail emulation); Wed, 03 Apr 2013 14:05:39 -0400 From: "Lennart Sorensen" Date: Wed, 3 Apr 2013 14:05:39 -0400 To: The development of GNU GRUB Subject: Re: [PATCH 3/7] Initial support for U-Boot platforms Message-ID: <20130403180539.GI21768@csclub.uwaterloo.ca> References: <515710E6.6090500@gmail.com> <20130403162451.GK23069@rocoto.smurfnet.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130403162451.GK23069@rocoto.smurfnet.nu> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 129.97.134.52 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 18:05:45 -0000 On Wed, Apr 03, 2013 at 04:24:51PM +0000, Leif Lindholm wrote: > Because I am an overtly paranoid person. :) That's not paranoid. That's just inefficient. The length argument has to be based on the target size, NOT the length of the source. If you want to length of the source, that's what plain old strcpy does by definition. I just found some of those in some other code I was cleaning up and wasn't pleased with them there. Just because it says strncpy doesn't mean what you are doing is any safer than strcpy if you do it wrong. -- Len Sorensen