Added user_strcpy()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5134 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -637,10 +637,8 @@ dprintf(const char *format,...)
|
|||||||
va_end(args);
|
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
|
// user_memcpy
|
||||||
|
extern "C"
|
||||||
int
|
int
|
||||||
user_memcpy(void *to, const void *from, size_t size)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//user_strcpy
|
||||||
|
extern "C"
|
||||||
|
int
|
||||||
|
user_strcpy(char *to, const char *from)
|
||||||
|
{
|
||||||
|
while ((*to++ = *from++) != '\0')
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// user_strlcpy
|
// user_strlcpy
|
||||||
/*! \brief Copies at most (\a size - 1) characters from the string in \a from to
|
/*! \brief Copies at most (\a size - 1) characters from the string in \a from to
|
||||||
the string in \a to, NULL-terminating the result.
|
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).
|
\return strlen(\a from).
|
||||||
*/
|
*/
|
||||||
|
extern "C"
|
||||||
int
|
int
|
||||||
user_strlcpy(char *to, const char *from, size_t size)
|
user_strlcpy(char *to, const char *from, size_t size)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user