diff --git a/include/xbps.h.in b/include/xbps.h.in index 6c1a7964..5b37c196 100644 --- a/include/xbps.h.in +++ b/include/xbps.h.in @@ -592,7 +592,7 @@ struct xbps_handle { * * Full path to the xbps configuration directory. */ - char confdir[XBPS_MAXPATH]; + char confdir[XBPS_MAXPATH+sizeof(XBPS_SYSCONF_PATH)]; /** * @var rootdir * @@ -606,14 +606,14 @@ struct xbps_handle { * Cache directory to store downloaded binary packages. * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). */ - char cachedir[XBPS_MAXPATH]; + char cachedir[XBPS_MAXPATH+sizeof(XBPS_CACHE_PATH)]; /** * @var metadir * * Metadata directory for all operations in XBPS. * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). */ - char metadir[XBPS_MAXPATH]; + char metadir[XBPS_MAXPATH+sizeof(XBPS_META_PATH)]; /** * @var native_arch * diff --git a/lib/initend.c b/lib/initend.c index 3a31fcfc..7b796148 100644 --- a/lib/initend.c +++ b/lib/initend.c @@ -397,7 +397,7 @@ int xbps_init(struct xbps_handle *xhp) { struct utsname un; - char cwd[PATH_MAX-1], sysconfdir[XBPS_MAXPATH], *buf; + char cwd[PATH_MAX-1], sysconfdir[XBPS_MAXPATH+sizeof(XBPS_SYSDEFCONF_PATH)], *buf; const char *repodir, *native_arch; int rv;