mirror of
https://github.com/ocornut/imgui.git
synced 2024-10-16 16:25:15 -05:00
ImStrncpy: Fixed -Wstringop-truncation warning on GCC8 (#2323)
This commit is contained in:
parent
ed240c910b
commit
aacf993ee1
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
if (count < 1) return;
|
||||
strncpy(dst, src, count);
|
||||
if (count > 1)
|
||||
strncpy(dst, src, count-1);
|
||||
dst[count-1] = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue