-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better support and testing for empty string_array #246
Conversation
Signed-off-by: Scott K Logan <logans@cottsay.net>
@dirk-thomas, I'm re-requesting review because I added a change to handle some inconsistent behavior due to an assumption based on implementation-specific behavior in malloc. Here are some docs, which describe what might happen if you malloc/realloc with size 0: http://man7.org/linux/man-pages/man3/malloc.3.html |
The documentation for malloc states that an attempt to allocate memory of size 0 results in implementation-specific behavior. Some implementations return `NULL`, and others return a pointer that is expected to be `free`'d. Signed-off-by: Scott K Logan <logans@cottsay.net>
958369a
to
abed4ac
Compare
@cottsay do you want to try to get this and the other pr's you opened into rcutils before I do a 1.0.0 release? I can try to help make that happen, but I also do not want to delay too long. |
At this point, it would just be "nice to have." I'm not sure I'll have time to actually take advantage of these changes before the release anyway. This one and #252 are a higher priority IMHO - they both improve the behavior of existing functions. |
Since I closed #252, I think you should move ahead with the release without the other two API additions. Thanks, @wjwwood! |
Oops missed the fact that you merged it. I'll cancel those CI and see what the nightlys bring. |
Specifically test for
string_array
s of size 0, and relax the null check inrcutils_string_array_cmp
when it won't be used.