Hacker News new | ask | show | jobs
by aslilac 1202 days 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`.

1 comments

Thats just idiomatic C. Set the "pointer to end" to be equal to the "pointer to start".