strncpy() is assumed to be for strings so the compiler assumes that
it will need an extra byte for the string-terminaning NULL.
For cases where we know it's actually "binary" data, just copy it
with memcpy.
https://bugzilla.gnome.org/show_bug.cgi?id=795756
{
memset (m, 0, sizeof (GstBinaryRegistryMagic));
- if (!strncpy (m->magic, GST_MAGIC_BINARY_REGISTRY_STR,
+ if (!memcpy (m->magic, GST_MAGIC_BINARY_REGISTRY_STR,
GST_MAGIC_BINARY_REGISTRY_LEN)
|| !strncpy (m->version, GST_MAGIC_BINARY_VERSION_STR,
GST_MAGIC_BINARY_VERSION_LEN)) {
gchar **ptr = ifaces;
while (*ptr) {
- strncpy (ifr.ifr_name, *ptr, IFNAMSIZ);
+ memcpy (ifr.ifr_name, *ptr, IFNAMSIZ);
if (ioctl (g_socket_get_fd (socket_event), SIOCGIFHWADDR, &ifr) == 0) {
clock_id_array[0] = ifr.ifr_hwaddr.sa_data[0];
clock_id_array[1] = ifr.ifr_hwaddr.sa_data[1];