darray: Fix bug in the darray_remove() macro
The memmove() call should be using the index argument to determine the number of bytes to copy. To be consistent with the rest of the code, we should also not evaluate the index parameter multiple times. Calling this with rand() % arr.size would otherwise generally segfault. Finally, we want to avoid using "index" as an identifier so as to not shadow index(3) in the C library. Signed-off-by: Damien Grassart <damien@grassart.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Showing
Please register or sign in to comment