9 ms·
NULL-terminated strings are understood to be the only acceptable way to pass around strings in C. safercopy() will not be writing or reading garbage from memor
by eranki 14y ago
NULL-terminated strings are understood to be the only acceptable way to pass around strings in C.
safercopy() will not be writing or reading garbage from memory, but the strings produced as output are not going to be well-formed unless the caller is being just as careful. e.g., safercopy gives me a string that I probably can't pass into printf, or to ANY C library for that matter.