Merge branch 'maint'

This commit is contained in:
Allan McRae 2015-01-21 14:27:25 +10:00
commit 92febc847c
2 changed files with 2 additions and 2 deletions

View File

@ -789,7 +789,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
while(safe_fgets(line, sizeof(line), fp) &&
(len = _alpm_strip_newline(line, 0))) {
if(!_alpm_greedy_grow((void **)&files, &files_size,
(files_size ? files_size + sizeof(alpm_file_t) : 8 * sizeof(alpm_file_t)))) {
(files_count ? (files_count + 1) * sizeof(alpm_file_t) : 8 * sizeof(alpm_file_t)))) {
goto error;
}
/* since we know the length of the file string already,

View File

@ -1328,7 +1328,7 @@ void *_alpm_greedy_grow(void **data, size_t *current, const size_t required)
return NULL;
}
return _alpm_realloc(data, current, required);
return _alpm_realloc(data, current, newsize);
}
void _alpm_alloc_fail(size_t size)