summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-02 22:38:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-02 22:38:13 (GMT)
commit34f0ead7c89b716c6a9f59f8dea6a9450e37e82a (patch)
treec1a41f5b11022e761becdb127d9180e46a58ede6 /src/common
parent537ed969ad0305e70dc2d503dbc49df859892717 (diff)
Given more flexibility to qinsert() for the inserted item.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/sort.c4
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;