From 1c35fbb33c424f27253f7e5412358da40fad51b5 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 21 Aug 2022 01:50:41 +0200 Subject: [PATCH] [util] Fix strlcpy compiler warning --- src/util/util_string.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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'; + } } }