diff options
Diffstat (limited to 'include/array.h')
-rw-r--r-- | include/array.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/array.h b/include/array.h index 8d52619..5f81798 100644 --- a/include/array.h +++ b/include/array.h @@ -11,7 +11,7 @@ #define array(T) struct { size_t len; T *data; } #define arraybuf(T) struct { size_t cap; size_t len; T *data; } -#define ARR_REMOVE(A, P) memmove((P), (P)+1, --(A).len * sizeof *(P) - ((P) - (A).data)); +#define ARR_REMOVE(A, P) memmove((P), (P)+1, sizeof *(P) * (--(A).len - ((P) - (A).data))); #define ARR_APPEND(A) (((A).cap == (A).len) \ ? (A).data = realloc((A).data, sizeof *(A).data * ((A).cap = (A).cap ? (A).cap * 2 : 1)) \ : NULL, &((A).data)[(A).len++]) |