Bart Smaalders <bart.smaald...@sun.com> wrote:

> All early strcpy implementations handle some overlapping copies 
> incorrectly.  In order to determine safety, it is necessary to
> find the length of the string before beginning the copy.

Could you please give us an example where this typical implementation:

char * 
strcpy(s1, s2) 
        register char           *s1; 
        register const char     *s2; 
{ 
        char     *ret   = s1; 
 
        while ((*s1++ = *s2++) != '\0') 
                ; 
        return (ret); 
} 

would handle overlapped strings incorrectly?

Jörg

-- 
 EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       j...@cs.tu-berlin.de                (uni)  
       joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to