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)
{
struct xferstat *xfer = cbdata;
static char str[16];
static char str[25];
long elapsed, eta;
off_t received, expected;

View File

@ -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
*

View File

@ -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);
}

View File

@ -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;