str_copy: Avoid -Wstringop-truncation warning in GCC8

This commit is contained in:
Dennis Felsing 2018-10-04 10:48:49 +02:00
parent 41d1a4802f
commit a21f01eef8

View file

@ -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 */
}