From: Florian Forster Date: Fri, 2 Jul 2010 18:27:51 +0000 (+0200) Subject: src/utils_array.c: Fix a segfault in "array_prepend". X-Git-Tag: v4.0.0~164 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=da4f69af961e91db6605a451dc3040c82c1a7344;p=collection4.git src/utils_array.c: Fix a segfault in "array_prepend". --- diff --git a/src/utils_array.c b/src/utils_array.c index 93e3568..0cc0bd7 100644 --- a/src/utils_array.c +++ b/src/utils_array.c @@ -104,7 +104,7 @@ int array_prepend (str_array_t *a, const char *entry) /* {{{ */ } a->ptr = ptr; - memmove (a->ptr, a->ptr + 1, sizeof (*a->ptr) * a->size); + memmove (a->ptr + 1, a->ptr, sizeof (*a->ptr) * a->size); a->ptr[0] = cpy; a->size++;