index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-11-13 18:19:28 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-12-12 12:56:48 -0600 |
commit | 8c8f04371745dad0bafcea14b38b4570e0b24a31 (patch) | |
tree | dae567a9f9b2e92e053d94924aaa50f7cedee09c /lib/libalpm/conflict.c | |
parent | 3d4656c0204956847a62c95b0f28747d7a0c2c05 (diff) |
-rw-r--r-- | lib/libalpm/conflict.c | 5 |
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 486f4bf3..d89fc532 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -465,8 +465,9 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, int resolved_conflict = 0; struct stat lsbuf; char path[PATH_MAX]; + size_t pathlen; - snprintf(path, PATH_MAX, "%s%s", handle->root, filestr); + pathlen = snprintf(path, PATH_MAX, "%s%s", handle->root, filestr); /* stat the file - if it exists, do some checks */ if(_alpm_lstat(path, &lsbuf) != 0) { @@ -490,7 +491,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, /* if we made it to here, we want all subsequent path comparisons to * not include the trailing slash. This allows things like file -> * directory replacements. */ - path[strlen(path) - 1] = '\0'; + path[pathlen - 1] = '\0'; } relative_path = path + strlen(handle->root); |