Skip to content

Commit

Permalink
nsexec.c: fix GCC 8 warning
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <[email protected]>
  • Loading branch information
runcom committed Apr 12, 2018
1 parent 3cbb2fa commit 1a50646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcontainer/nsenter/nsexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ void join_namespaces(char *nslist)

ns->fd = fd;
ns->ns = nsflag(namespace);
strncpy(ns->path, path, PATH_MAX);
strncpy(ns->path, path, PATH_MAX - 1);
ns->path[PATH_MAX - 1] = '\0';
} while ((namespace = strtok_r(NULL, ",", &saveptr)) != NULL);

/*
Expand Down

0 comments on commit 1a50646

Please sign in to comment.