72060a2b2b
We were using strncpy(3), which is designed to copy from a string into a (null-padded) fixed-size character array. However, we were doing the opposite: copying from a known-size array (which was a prefix of a string), into a string. That's why we had to manually zero the buffer afterwards. Use instead mempcpy(3) to copy the non-null bytes, and then terminate with a null byte with stpcpy(..., ""). Cc: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
5.1 KiB
5.1 KiB