Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-08-21 02:50:41 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-08-21 02:52:08 +0300
commit859a0678c3a7d9a5c2cb86bbcb4a35d783f76542 (patch)
treef970709a0d621773e9d3ffa4ba625b1442253988
parent16ff9b48cdc05fb82f526fdc66fc87e1528a8d71 (diff)
[util] Fix strlcpy compiler warningfix-annoying-warning
-rw-r--r--src/util/util_string.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/util_string.h b/src/util/util_string.h
index 114bf63e..f4810728 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';
+ }
}
}