* r33436 broke user_strlcpy() semantics: with a size of 0, "to" can be ignored,
and it's still a valid call. * This fixes ktrace_printf() from userland. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33934 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fec0112f9a
commit
ebcdd1fc61
@ -5580,9 +5580,9 @@ user_memcpy(void* to, const void* from, size_t size)
|
||||
ssize_t
|
||||
user_strlcpy(char* to, const char* from, size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
return 0;
|
||||
if (from == NULL || to == NULL)
|
||||
if (to == NULL && size != 0)
|
||||
return B_BAD_VALUE;
|
||||
if (from == NULL)
|
||||
return B_BAD_ADDRESS;
|
||||
|
||||
// limit size to avoid address overflows
|
||||
|
Loading…
Reference in New Issue
Block a user