Page MenuHomeFreeBSD

strlcpy/strlcat: Remove references to snprintf
ClosedPublic

Authored by imp on Nov 15 2020, 8:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 21 2024, 6:15 PM
Unknown Object (File)
Dec 20 2023, 7:41 AM
Unknown Object (File)
Dec 14 2023, 7:05 PM
Unknown Object (File)
Oct 31 2023, 2:56 AM
Unknown Object (File)
Oct 27 2023, 4:18 PM
Unknown Object (File)
Sep 4 2023, 11:58 PM
Unknown Object (File)
Jul 12 2023, 6:07 AM
Unknown Object (File)
Jan 9 2023, 1:25 AM

Details

Summary

While these are simila to snprintf, it's not ultimately helpful to say they are
the same. The fiddly differences aren't so fiddly, it turns out. Reword to make
this clear.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Nov 15 2020, 8:00 PM
imp created this revision.
scottl added inline comments.
lib/libc/string/strlcpy.3
131

I think it's essential to remove the passage in this section about strlcat and snprintf being equivalent. Otherwise you still have conflicting text, and now you've added even more conflicting and vague (the use of "some systems" here) text. Since the implementation of strlcat() is completely independent of snprintf(), nothing is gained by conveying or implying equivalence in the man page.

Should be fine. Maybe a separate CAVEATS section would be more suitable for this kind of note.

Update based on Scott's feedback

imp retitled this revision from Note slight difference between strlcpy and snprintf return values to strlcpy/strlcat: Remove references to snprintf.Jan 26 2021, 9:44 PM
imp edited the summary of this revision. (Show Details)
bcr added a subscriber: bcr.

OK from manpages.

While these are simila to snprintf, it's not ultimately helpful to say they are the same.

They aren't the same but they are similar enough in usage (which is more important than how they relate to each other in implementation) to be cross referenced their respective manual pages.
I would even add a memccpy(3) reference here.

not working on this anymore.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 27 2023, 4:18 PM
This revision was automatically updated to reflect the committed changes.

Not sure memccpy is useful to bring up here, so left that out.
The point of the commit is to reduce tenuous comparisons, not increase them.