Bart Smaalders <[email protected]> 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:[email protected] (home) Jörg Schilling D-13353 Berlin
       [email protected]                (uni)  
       [email protected] (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to