1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[util] Fix strlcpy compiler warning

This commit is contained in:
Philip Rebohle 2022-08-21 01:50:41 +02:00 committed by Joshie
parent f80347d9a9
commit 1c35fbb33c

View File

@ -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';
}
}
}