diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-10-02 22:38:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-10-02 22:38:13 (GMT) |
commit | 34f0ead7c89b716c6a9f59f8dea6a9450e37e82a (patch) | |
tree | c1a41f5b11022e761becdb127d9180e46a58ede6 /src/common | |
parent | 537ed969ad0305e70dc2d503dbc49df859892717 (diff) |
Given more flexibility to qinsert() for the inserted item.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/sort.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/sort.c b/src/common/sort.c index df1df82..ee6cf2e 100644 --- a/src/common/sort.c +++ b/src/common/sort.c @@ -123,7 +123,7 @@ void *qinsert(void *base, size_t *nmemb, size_t size, __compar_fn_t compar, void void *result; /* Tableau trié à retourner */ size_t index; /* Indice du point d'insertion */ - bsearch_index(&new, base, *nmemb, size, compar, &index); + bsearch_index(new, base, *nmemb, size, compar, &index); result = realloc(base, (*nmemb + 1) * size); @@ -132,7 +132,7 @@ void *qinsert(void *base, size_t *nmemb, size_t size, __compar_fn_t compar, void (*nmemb)++; - memcpy((char *)result + index * size, &new, size); + memcpy((char *)result + index * size, new, size); return result; |