--- src/cppcomp.h.orig 2013-04-28 22:48:29.000000000 +0900 +++ src/cppcomp.h 2014-09-10 13:27:05.000000000 +0900 @@ -274,7 +274,7 @@ static inline void strncpy_s(char * de, size_t de_size, const char * so, size_t count) { const size_t sourcelen = strlen(so); size_t tobecopied = sourcelen < count ? sourcelen : count; - if ( tobecopied < de_size ) { + if ( tobecopied <= de_size ) { while (so && *so && (tobecopied > 0) ) { *de = *so; ++de; ++so; --tobecopied; } // does not copy final 0