Make sure there's NUL byte at the end of strndupa
authorLucas De Marchi <lucas.demarchi@intel.com>
Mon, 7 Apr 2014 15:27:11 +0000 (12:27 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 7 Apr 2014 15:30:04 +0000 (12:30 -0300)
commitf5cdd574a531ed156d30efe2e06c4cf463469588
tree26e07952aea7dddd8e2f5701c5efaaa4f7d9e6fa
parent04c0956e207e3b27a700494f8dc77f902cd53731
Make sure there's NUL byte at the end of strndupa

Since strcpy() doesn't ensure we have a NUL byte in the resulting
string, use alloca() + memcpy(). Also make sure we don't evaluate "s"
twice.
libkmod/missing.h