mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
str_copy: Avoid -Wstringop-truncation warning in GCC8
This commit is contained in:
parent
41d1a4802f
commit
a21f01eef8
|
@ -2179,7 +2179,7 @@ void str_append(char *dst, const char *src, int dst_size)
|
|||
|
||||
void str_copy(char *dst, const char *src, int dst_size)
|
||||
{
|
||||
strncpy(dst, src, dst_size);
|
||||
strncpy(dst, src, dst_size-1);
|
||||
dst[dst_size-1] = 0; /* assure null termination */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue