Re:Stop using strncpy already
by dchichkov on Thursday April 04, 2013 @05:08AM
(#5491666)
>> Then strncpy() will happily 0-fill all of that buffer space
Yes. And that feels like a really poor choice of the function name in my opinion. It should have been strcpy_pad_with_zeros() rather than strncpy(). To reflect the fact that it is going to waste precious cache lines and memory writes.
Yes. And that feels like a really poor choice of the function name in my opinion. It should have been strcpy_pad_with_zeros() rather than strncpy(). To reflect the fact that it is going to waste precious cache lines and memory writes.