diff --git a/bin/xbps-install/fetch_cb.c b/bin/xbps-install/fetch_cb.c index a0f158d3..8d10ac17 100644 --- a/bin/xbps-install/fetch_cb.c +++ b/bin/xbps-install/fetch_cb.c @@ -65,7 +65,7 @@ static const char * stat_eta(const struct xbps_fetch_cb_data *xfpd, void *cbdata) { struct xferstat *xfer = cbdata; - static char str[16]; + static char str[25]; long elapsed, eta; off_t received, expected; 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/fetch/ftp.c b/lib/fetch/ftp.c index e7ba9039..28296a00 100644 --- a/lib/fetch/ftp.c +++ b/lib/fetch/ftp.c @@ -339,7 +339,7 @@ ftp_cwd(conn_t *conn, const char *path, int subdir) len = strlen(pwd); /* Look for a common prefix between PWD and dir to fetch. */ - for (i = 0; i <= len && i <= end - dst; ++i) + for (i = 0; i < len && i < end - dst; ++i) if (pwd[i] != dst[i]) break; /* Keep going up a dir until we have a matching prefix. */ @@ -440,10 +440,6 @@ ftp_mode_type(conn_t *conn, int mode, int type) type = 'A'; case 'A': break; - case 'd': - type = 'D'; - case 'D': - /* can't handle yet */ default: return (FTP_PROTOCOL_ERROR); } 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;