[Python-bugs-list] [ python-Bugs-487703 ] Replace strcat, strcpy

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Mar 2002 08:56:29 -0800


Bugs item #487703, was opened at 2001-11-30 22:39
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=487703&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
>Assigned to: Tim Peters (tim_one)
Summary: Replace strcat, strcpy

Initial Comment:
Alex Martelli sent this URL for a paper describing the 
safer strlcat and strlcpy functions:

>http://www.usenix.org/events/usenix99/full_papers/mill
ert/millert_html/>

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

>Comment By: Neil Schemenauer (nascheme)
Date: 2002-03-22 16:56

Message:
Logged In: YES 
user_id=35752


If they want people to use their code why do they put that
stupid clause in the license?  How annoying.  Attached is
a strlcpy function that I wrote based on the man page:

http://www.tac.eu.org/cgi-bin/man-cgi?strlcpy+3

Do whatever you like with it. :-)  I would appreciate it if
someone would review the code however.  There are a number
of corner cases that are easy to screw up.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-11 22:51

Message:
Logged In: YES 
user_id=6380

Strictly speaking, binary Python distributions would be
required to contain a copy of the entire license for that
file. I don't like that.

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

Comment By: Tim Peters (tim_one)
Date: 2001-12-03 18:59

Message:
Logged In: YES 
user_id=31435

I'm attaching a patch from Alex Martelli; haven't reviewed 
it, and don't expect to before 2.2 final is released.

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2001-12-03 10:47

Message:
Logged In: YES 
user_id=38388

Time for PyOS_strlcat() and PyOS_strlcpy() ? Looking at the web-site it seems that we could simply copy the 
code into the Python distro. I'd then suggest to bundle all the string helpers into a new file: e.g. mystrapis.c.

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

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