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)
Fri, Oct 18, 11:10 PM
Unknown Object (File)
Oct 3 2024, 10:52 PM
Unknown Object (File)
Oct 2 2024, 2:29 PM
Unknown Object (File)
Sep 27 2024, 7:32 AM
Unknown Object (File)
Sep 27 2024, 7:18 AM
Unknown Object (File)
Sep 27 2024, 4:16 AM
Unknown Object (File)
Sep 19 2024, 12:47 AM
Unknown Object (File)
Sep 18 2024, 12:07 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.