Added user_strcpy()

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5134 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-10-24 09:37:50 +00:00
parent 27b54f4499
commit 3ec998df56

View File

@ -637,10 +637,8 @@ dprintf(const char *format,...)
va_end(args);
}
extern "C" int user_memcpy(void *to, const void *from, size_t size);
extern "C" int user_strlcpy(char *to, const char *from, size_t size);
// user_memcpy
extern "C"
int
user_memcpy(void *to, const void *from, size_t size)
{
@ -653,6 +651,16 @@ user_memcpy(void *to, const void *from, size_t size)
return 0;
}
//user_strcpy
extern "C"
int
user_strcpy(char *to, const char *from)
{
while ((*to++ = *from++) != '\0')
;
return 0;
}
// user_strlcpy
/*! \brief Copies at most (\a size - 1) characters from the string in \a from to
the string in \a to, NULL-terminating the result.
@ -663,6 +671,7 @@ user_memcpy(void *to, const void *from, size_t size)
\return strlen(\a from).
*/
extern "C"
int
user_strlcpy(char *to, const char *from, size_t size)
{