diff --git a/src/util/util_string.h b/src/util/util_string.h index 114bf63ef..f4810728f 100644 --- a/src/util/util_string.h +++ b/src/util/util_string.h @@ -205,9 +205,10 @@ namespace dxvk::str { } inline void strlcpy(char* dst, const char* src, size_t count) { - std::strncpy(dst, src, count); - if (count > 0) + if (count > 0) { + std::strncpy(dst, src, count - 1); dst[count - 1] = '\0'; + } } }