Index: source/Host/common/FileSpec.cpp =================================================================== --- source/Host/common/FileSpec.cpp +++ source/Host/common/FileSpec.cpp @@ -782,7 +782,8 @@ std::string result = GetPath(denormalize); size_t result_length = std::min(path_max_len-1, result.length()); - ::strncpy(path, result.c_str(), result_length + 1); + ::strncpy(path, result.c_str(), result_length); + path[result_length] = '\0'; return result_length; }