Skip to content

Commit

Permalink
network: silence gcc-8
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent 00a3088 commit 04cf915
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/network.c
Expand Up @@ -2097,8 +2097,8 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna
return -1;
}

memset(netdev->name, 0, IFNAMSIZ + 1);
strncpy(netdev->name, token, IFNAMSIZ);
memset(netdev->name, 0, IFNAMSIZ);
memcpy(netdev->name, token, IFNAMSIZ - 1);

/* netdev->ifindex */
token = strtok_r(NULL, ":", &saveptr);
Expand Down

0 comments on commit 04cf915

Please sign in to comment.