From e826c143d3e9d21485f72c5490b2a907c936024e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 9 Jun 2011 13:41:08 -0500 Subject: 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 --- lib/libalpm/handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/handle.c') 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; -- cgit v1.2.3-24-g4f1b