4 ms·
Added to POSIX is good, but not sufficient. E.g., there is no reason for Windows to implement a function merely because it's in the POSIX spec. It needs to be i
by hyc_symas 11y ago
Added to POSIX is good, but not sufficient. E.g., there is no reason for Windows to implement a function merely because it's in the POSIX spec. It needs to be in the C spec to actually be viable.
stpncpy is equivalent to strncpy - it NUL-pads dest if the src is shorter than N. Frankly I have never found a use for this behavior. The desired behavior is to simply copy src without additional padding. That is what my proposed strecopy() does, and that's what would be required of a replacement for strlcpy().