|
|
Log in / Subscribe / Register

Ushering out strlcpy()

Ushering out strlcpy()

Posted Aug 30, 2022 14:58 UTC (Tue) by NYKevin (subscriber, #129325)
In reply to: Ushering out strlcpy() by milesrout
Parent article: Ushering out strlcpy()

IMHO it is not totally unreasonable to expect strncpy(src) to be equivalent to snprintf("%s", size, src), because strcpy(src) is actually equivalent to sprintf("%s", src).

(Incidentally, snprintf is just about the only portable function that DTRT in this context.)


to post comments

Ushering out strlcpy()

Posted Aug 30, 2022 14:59 UTC (Tue) by NYKevin (subscriber, #129325) [Link]

(Oops, I put the arguments in the wrong order, but you know what I mean.)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds