Merge pull request #254 from AgustinCB/fix-compilation

Fix compilation errors on GCC 7
This commit is contained in:
Juan RP 2017-10-25 09:11:20 +02:00 committed by GitHub
commit cd7f39421d
4 changed files with 6 additions and 10 deletions

View File

@ -65,7 +65,7 @@ static const char *
stat_eta(const struct xbps_fetch_cb_data *xfpd, void *cbdata) stat_eta(const struct xbps_fetch_cb_data *xfpd, void *cbdata)
{ {
struct xferstat *xfer = cbdata; struct xferstat *xfer = cbdata;
static char str[16]; static char str[25];
long elapsed, eta; long elapsed, eta;
off_t received, expected; off_t received, expected;

View File

@ -592,7 +592,7 @@ struct xbps_handle {
* *
* Full path to the xbps configuration directory. * Full path to the xbps configuration directory.
*/ */
char confdir[XBPS_MAXPATH]; char confdir[XBPS_MAXPATH+sizeof(XBPS_SYSCONF_PATH)];
/** /**
* @var rootdir * @var rootdir
* *
@ -606,14 +606,14 @@ struct xbps_handle {
* Cache directory to store downloaded binary packages. * Cache directory to store downloaded binary packages.
* If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). * 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 * @var metadir
* *
* Metadata directory for all operations in XBPS. * Metadata directory for all operations in XBPS.
* If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). * 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 * @var native_arch
* *

View File

@ -339,7 +339,7 @@ ftp_cwd(conn_t *conn, const char *path, int subdir)
len = strlen(pwd); len = strlen(pwd);
/* Look for a common prefix between PWD and dir to fetch. */ /* 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]) if (pwd[i] != dst[i])
break; break;
/* Keep going up a dir until we have a matching prefix. */ /* 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'; type = 'A';
case 'A': case 'A':
break; break;
case 'd':
type = 'D';
case 'D':
/* can't handle yet */
default: default:
return (FTP_PROTOCOL_ERROR); return (FTP_PROTOCOL_ERROR);
} }

View File

@ -397,7 +397,7 @@ int
xbps_init(struct xbps_handle *xhp) xbps_init(struct xbps_handle *xhp)
{ {
struct utsname un; 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; const char *repodir, *native_arch;
int rv; int rv;