diff --git a/engine/source/utils.c b/engine/source/utils.c index 9156c8120..7d7d33cbb 100644 --- a/engine/source/utils.c +++ b/engine/source/utils.c @@ -541,6 +541,7 @@ char* safe_strncpy(char* dest, const char* source, size_t size) char src[size + 1]; memset(src,'\0',size + 1); strncpy(src,source,size); + src[size] = '\0'; strncpy(dest,src,size); return dest; }