diff options
Diffstat (limited to 'lib/string.c')
-rw-r--r-- | lib/string.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c index 2d0a99eab7..b63041c5fb 100644 --- a/lib/string.c +++ b/lib/string.c @@ -100,6 +100,19 @@ char * strcpy(char * dest,const char *src) #endif EXPORT_SYMBOL(strcpy); +/** + * stpcpy - Copy a %NUL terminated string, but return pointer to %NUL + * @dest: Where to copy the string to + * @src: Where to copy the string from + */ +char *stpcpy(char *dest, const char *src) +{ + while ((*dest++ = *src++) != '\0') + /* nothing */; + return dest - 1; +} +EXPORT_SYMBOL(stpcpy); + #ifndef __HAVE_ARCH_STRNCPY /** * strncpy - Copy a length-limited, %NUL-terminated string |