3 ms·
~~Isn't the handling of `endptr` incorrect in `DYN_ARR_RESET` as well? `a.endptr = a.data;` feels very incorrect to me.~~ Nevermind, I see how it's supposed to
by aslilac 4y ago
~~Isn't the handling of `endptr` incorrect in `DYN_ARR_RESET` as well? `a.endptr = a.data;` feels very incorrect to me.~~
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`.
- parasti 4y agoThats just idiomatic C. Set the "pointer to end" to be equal to the "pointer to start".