core: replace call to strncpy by memcpy

This fixes a gcc warning: "warning: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]".
This commit is contained in:
Sébastien Helleu 2018-10-21 08:54:04 +02:00
parent eb77c78dad
commit 438313d331

View File

@ -274,7 +274,7 @@ gui_input_insert_string (struct t_gui_buffer *buffer, const char *string,
/* insert new string */
ptr_start = (char *)utf8_add_offset (buffer->input_buffer, pos);
strncpy (ptr_start, string_utf8, size);
memcpy (ptr_start, string_utf8, size);
buffer->input_buffer_pos += length;
}