Skip to content

Commit

Permalink
confile: s/MAXPATHLEN/PATH_MAX/g
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 Oct 7, 2018
1 parent 6b5a54c commit 1874031
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -2068,7 +2068,7 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf)
{
struct dirent *direntp;
DIR *dir;
char path[MAXPATHLEN];
char path[PATH_MAX];
int len;
int ret = -1;

Expand All @@ -2090,8 +2090,8 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf)
if (len < 6 || strncmp(fnam + len - 5, ".conf", 5) != 0)
continue;

len = snprintf(path, MAXPATHLEN, "%s/%s", dirp, fnam);
if (len < 0 || len >= MAXPATHLEN) {
len = snprintf(path, PATH_MAX, "%s/%s", dirp, fnam);
if (len < 0 || len >= PATH_MAX) {
ret = -1;
goto out;
}
Expand Down

0 comments on commit 1874031

Please sign in to comment.