Adjusted the fake goto, so that passing a NULL target buffer together
with a 0 size to user_strlcpy() is OK. This way one can use it as a safe strnlen(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23617 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c4c5cd4d4a
commit
aba70a8ca2
@ -622,7 +622,7 @@ arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr_t *faultHand
|
||||
addr_t oldFaultHandler = *faultHandler;
|
||||
|
||||
// this check is to trick the gcc4 compiler and have it keep the error label
|
||||
if (to == NULL)
|
||||
if (to == NULL && size > 0)
|
||||
goto error;
|
||||
|
||||
*faultHandler = (addr_t)&&error;
|
||||
|
Loading…
Reference in New Issue
Block a user