|
|
|
|
|
by orbital223
1202 days ago
|
|
DYN_ARR_RESET should probably be called DYN_ARR_INIT instead, as calling it more than once will leak memory. The handling of endptr in DYN_ARR_RESIZE seems to be incorrect. If I have an array with 2 elements and capacity of 3 and I DYN_ARR_RESIZE it to 5, I now have an array with 5 elements, 3 of which are garbage values. |
|
Nevermind, I see how it's supposed to work now.
To your point, `RESIZE` is definitely incorrect. It should be checking the length before calling `realloc`.