[Patches] [ python-Patches-491401 ] Changes strncpy to memcpy for opt

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Dec 2001 12:38:33 -0800


Patches item #491401, was opened at 2001-12-10 18:27
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=491401&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: David Jacobs (dbj)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: Changes strncpy to memcpy for opt

Initial Comment:
This patch replaces uses of strncpy with memcpy where 
appropriate.

strncpy incurs the overhead of checking for a 
premature '\0' ending to the string.  In cases where 
we know where the string terminates (e.g., we have 
performed a strlen) memcpy can safely replace strncpy.

David Jacobs
jacobsl001@hawaii.rr.com

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-11 12:38

Message:
Logged In: YES 
user_id=6380

Rejected, see #491351 for reason.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=491401&group_id=5470