Re: strscpy
Martin Husemann <[email protected]> Tue, 19 May 2020 07:44:08 +0200
| Newsgroups | gmane.os.netbsd.devel.security |
|---|---|
| Message-ID | <[email protected]> |
On Tue, May 19, 2020 at 07:31:39AM +0200, Maxime Villard wrote: > copystr() has a small dozen of users. nxr only finds two - can we please fix that and have a version that does a full index? > https://m00nbsd.net/garbage/libkern/strscpy.diff I find that function totally ugly, (a) due to the return value overload and (b) why would any caller care to tell the two possible error values apart? and (c) it leaves the destination non-null terminated in one of the failure cases. Martin