Re:Stop using strncpy already
by Aloisius on Thursday April 04, 2013 @03:41AM
(#5491484)
The string: [This ] The len: 5
Doesn't it bother you that your 5 character long buffer that is supposed to be terminated by a null happens to have 5 characters in it "[This ]" instead of 4 visible "[This]"?
Your memory just happens to have a null 6 bytes after the pointer.
Your memory just happens to have a null 6 bytes after the pointer.