commit | aacf993ee15c4d168fb5528d8f78f4cb1767dc04 | [log] [tgz] |
---|---|---|
author | Francisco Gallego <ronaldo@cheesetea.com> | Wed Jan 30 10:19:40 2019 +0100 |
committer | omar <ocornut@users.noreply.github.com> | Wed Jan 30 10:19:40 2019 +0100 |
tree | 1082e6c543b36e052005e43ab520004dc903118c | |
parent | ed240c910bb1019a23c59806f7856bebe181cef7 [diff] |
ImStrncpy: Fixed -Wstringop-truncation warning on GCC8 (#2323)
diff --git a/imgui.cpp b/imgui.cpp index 8d85935..4fd20a9 100644 --- a/imgui.cpp +++ b/imgui.cpp
@@ -1295,7 +1295,8 @@ void ImStrncpy(char* dst, const char* src, size_t count) { if (count < 1) return; - strncpy(dst, src, count); + if (count > 1) + strncpy(dst, src, count-1); dst[count-1] = 0; }