Merge branch 'allan/pathmax' into 'master'
Adjust PATH_MAX length tests using snprintf See merge request pacman/pacman!288
This commit is contained in:
commit
1d5c52e30b
1 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ static int sync_cleandb(const char *dbpath)
|
||||||
|
|
||||||
/* build the full path */
|
/* build the full path */
|
||||||
len = snprintf(path, PATH_MAX, "%s%s", dbpath, dname);
|
len = snprintf(path, PATH_MAX, "%s%s", dbpath, dname);
|
||||||
if(len > PATH_MAX) {
|
if(len >= PATH_MAX) {
|
||||||
pm_printf(ALPM_LOG_ERROR, _("could not remove %s%s: path exceeds PATH_MAX\n"),
|
pm_printf(ALPM_LOG_ERROR, _("could not remove %s%s: path exceeds PATH_MAX\n"),
|
||||||
dbpath, dname);
|
dbpath, dname);
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ static int sync_cleancache(int level)
|
||||||
|
|
||||||
/* build the full filepath */
|
/* build the full filepath */
|
||||||
len=snprintf(path, PATH_MAX, "%s%s", cachedir, ent->d_name);
|
len=snprintf(path, PATH_MAX, "%s%s", cachedir, ent->d_name);
|
||||||
if(len > PATH_MAX) {
|
if(len >= PATH_MAX) {
|
||||||
pm_printf(ALPM_LOG_ERROR, _("skipping %s%s: path exceeds PATH_MAX\n"),
|
pm_printf(ALPM_LOG_ERROR, _("skipping %s%s: path exceeds PATH_MAX\n"),
|
||||||
cachedir, ent->d_name);
|
cachedir, ent->d_name);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue