mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 08:18:51 -05:00
pacsort: correct pointer type in list_new
Pointer sizes are the same but this makes intention clearer. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
d9e5dab6ac
commit
e9b8a7693d
@ -103,7 +103,7 @@ static struct list_t *list_new(size_t initial_size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
list->list = calloc(initial_size, sizeof(char **));
|
list->list = calloc(initial_size, sizeof(char *));
|
||||||
if(!list->list) {
|
if(!list->list) {
|
||||||
free(list);
|
free(list);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -117,7 +117,7 @@ static struct list_t *list_new(size_t initial_size)
|
|||||||
static int list_grow(struct list_t *list)
|
static int list_grow(struct list_t *list)
|
||||||
{
|
{
|
||||||
size_t newsz = list->maxcount * 2.5;
|
size_t newsz = list->maxcount * 2.5;
|
||||||
list->list = realloc(list->list, newsz * sizeof(char*));
|
list->list = realloc(list->list, newsz * sizeof(char *));
|
||||||
if(!list->list) {
|
if(!list->list) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user