summaryrefslogtreecommitdiff
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-09 13:41:08 -0500
committerDan McGee <dan@archlinux.org>2011-06-09 14:16:55 -0500
commite826c143d3e9d21485f72c5490b2a907c936024e (patch)
treeca08e8327d7431d8ce97e6a3420def97a4f57620 /lib/libalpm/handle.c
parent9d6568da0f55fb05ea5c28e06efb51046fd270bf (diff)
downloadpacman-e826c143d3e9d21485f72c5490b2a907c936024e.tar.xz
Kill all remaining 'PATH_MAX + 1' usages
The few remaining instances were utilized for buffers in calls to snprintf() and realpath(). Both of these functions will always ensure the returned value is padded with '\0', so there is no need for the extra byte. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 80ad5601..730372a7 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -328,7 +328,7 @@ enum _pmerrno_t _alpm_set_directory_option(const char *value,
if(stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
return PM_ERR_NOT_A_DIR;
}
- real = calloc(PATH_MAX + 1, sizeof(char));
+ real = calloc(PATH_MAX, sizeof(char));
if(!realpath(path, real)) {
free(real);
return PM_ERR_NOT_A_DIR;