From: Julian Seward Date: Sun, 21 Dec 2003 23:29:16 +0000 (+0000) Subject: Add a vanilla implementation of stpcpy(). Does not do overlap checking X-Git-Tag: svn/VALGRIND_2_1_1~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bd93ba4d9296c490d64abb957fbab1087f5fb74;p=thirdparty%2Fvalgrind.git Add a vanilla implementation of stpcpy(). Does not do overlap checking (it should). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2137 --- diff --git a/memcheck/mac_replace_strmem.c b/memcheck/mac_replace_strmem.c index 12560f647b..f37ba234c1 100644 --- a/memcheck/mac_replace_strmem.c +++ b/memcheck/mac_replace_strmem.c @@ -320,6 +320,23 @@ int memcmp ( const void *s1V, const void *s2V, unsigned int n ) return 0; } +/* glibc-2.3.2/sysdeps/generic/stpcpy.c */ +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} + /*--------------------------------------------------------------------*/ /*--- end mac_replace_strmem.c ---*/ /*--------------------------------------------------------------------*/