mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
ImStrncpy: Fixed -Wstringop-truncation warning on GCC8 (#2323)
This commit is contained in:
parent
ed240c910b
commit
aacf993ee1
@ -1295,7 +1295,8 @@ int ImStrnicmp(const char* str1, const char* str2, size_t count)
|
|||||||
void ImStrncpy(char* dst, const char* src, size_t count)
|
void ImStrncpy(char* dst, const char* src, size_t count)
|
||||||
{
|
{
|
||||||
if (count < 1) return;
|
if (count < 1) return;
|
||||||
strncpy(dst, src, count);
|
if (count > 1)
|
||||||
|
strncpy(dst, src, count-1);
|
||||||
dst[count-1] = 0;
|
dst[count-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user