From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Belmonte Subject: Re: [PATCH] Toshiba ACPI Extras 0.16 Date: Sat, 26 Jul 2003 17:25:04 -0400 Sender: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Message-ID: <3F22F1B0.9080607@prairienet.org> References: <3F21BD11.8060405@prairienet.org> <20030726052012.GO1485@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20030726052012.GO1485-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org> Errors-To: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: acpi-devel List-Id: linux-acpi@vger.kernel.org Matthew Wilcox wrote: > seems to me you'd be better off doing ... > > len = strlen(str); > if (len > n) > len = n; > memcpy(str2, str, n); > str2[n] = '\0'; > > i wrote a short note entitled "strncpy Considered Harmful" a few years ago. > unfortunately, it seems lost in time. Since you have that experience then I would expect you to consider whether str is zero-terminated before suggesting that I change my code. -- http:// if l .o / ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01