3 ms·
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
by Night_Thastus 4y ago
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.
- zabzonk 4y ago> strcpy_s is part of the C11 standard an optional part, which makes it pretty worthless, if it were not so already.