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/conflict.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 89214707..dc067290 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -363,7 +363,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle, for(current = 0, i = upgrade; i; i = i->next, current++) { alpm_list_t *k, *tmpfiles = NULL; pmpkg_t *p1, *p2, *dbpkg; - char path[PATH_MAX+1]; + char path[PATH_MAX]; p1 = i->data; if(!p1) { @@ -480,9 +480,9 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle, } if(!resolved_conflict && dbpkg) { - char *rpath = calloc(PATH_MAX+1, sizeof(char)); + char *rpath = calloc(PATH_MAX, sizeof(char)); if(!realpath(path, rpath)) { - FREE(rpath); + free(rpath); continue; } char *filestr = rpath + strlen(handle->root); -- cgit v1.2.3