On 29/10/2016 23:41, Jérôme Duval wrote:
2016-10-29 22:57 GMT+02:00 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
Shouldn't that be something like:
int needed = strlcpy(name, pw->pw_name, nameSize);
if (needed > nameSize)
return ENOMEM;
return B_OK;
?
Why only accept "name" if it's equal or larger than the maximum, and then
only write the maximum to it?
Maybe ask François:
http://cgit.haiku-os.org/haiku/commit/?id=ffb64301bf46d864cb7f798bd4085227107f941a
I think you're right, the return code should be ERANGE though.