Re: strscpy
Kamil Rytarowski <[email protected]> Tue, 19 May 2020 19:40:13 +0200
| Newsgroups | gmane.os.netbsd.devel.security |
|---|---|
| Message-ID | <[email protected]> |
On 19.05.2020 19:15, Maxime Villard wrote: > I would want to keep the difference minimal between the two. I think > that the > version that returns -1 is nice and addresses the concern. What do you > think? Personally I have got no strong opinion. I would change "size > INT_MAX" to "size > SSIZE_MAX". Returning -1 instead of -EINVAL and -E2BIG is good, as there few users who check return value at all, and if so, they check whether it is less than 0.