News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by Night_Thastus on Thursday April 06, 2023 @11:08AM (#35469351)
strlcpy is not needed, strcpy_s (not strncpy_s) is safe and is part of the C11 standard.|

In fact, strlcpy is worse:

* strlcpy truncates the source string to fit in the destination (which is a security risk)

* strlcpy does not perform all the runtime checks that strcpy_s does

* strlcpy does not make failures obvious by setting the destination to a null string or calling a handler if the call fails.

Re:C Strings and my slow descent to madness by zabzonk on Thursday April 06, 2023 @11:23AM (#35469608)
> strcpy_s is part of the C11 standard

an optional part, which makes it pretty worthless, if it were not so already.