3 ms·
The irony of strncpy is it's supposed to eliminate memory corruption errors, but instead is a prolific source of them.
by WalterBright 6y ago
The irony of strncpy is it's supposed to eliminate memory corruption errors, but instead is a prolific source of them.
- Gibbon1 6y agoI think I read somewhere the provenience of strncpy was to copy strings into a fixed length field which is why it has the deranged behavior of not terminating the string. Think file systems where the max file name is 8 characters. Or compilers that truncated variable names at 31.