WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-devel] [PATCH] Clean up and fix errors in strncpy -> strlcpy co

To: Christoph Egger <Christoph.Egger@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Clean up and fix errors in strncpy -> strlcpy conversion
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 30 Jan 2007 09:32:23 +0000
Cc: Aron Griffis <aron@xxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 Jan 2007 01:32:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200701300923.08382.Christoph.Egger@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdEUYuwygb+aLBEEduN2AAX8io7RQ==
Thread-topic: [Xen-devel] [PATCH] Clean up and fix errors in strncpy -> strlcpy conversion
User-agent: Microsoft-Entourage/11.2.5.060620
On 30/1/07 08:23, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:

> In my patch, safe_strcpy() is gone. And anyway, if safe_strcpy works as
> expected, then apart from the return value there's no difference to
> strlcpy().

I kept safe_strcpy() now implemented over strlcpy() and returns non-zero if
the result is truncated. When writing into a char array this is less
redundant than writing (strlcpy(d,s,sizeof(d) >= sizeof(d)) where 'd' is
often some annoyingly long structural name.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel