Skip to content
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

getenv_s calls error handler for "normal" errors #119

Closed
bossmc opened this issue Jul 11, 2022 · 3 comments
Closed

getenv_s calls error handler for "normal" errors #119

bossmc opened this issue Jul 11, 2022 · 3 comments
Labels
Milestone

Comments

@bossmc
Copy link
Contributor

bossmc commented Jul 11, 2022

Prior to d424528, getenv_s would only call the error handler callback if the failure was caused by one of the safety checks (buffers too long/short, NULL pointers etc) but in that change it was changed to call into handle_error in the "Variable not found" error case (seemingly in order to invoke the "Null Slack" function to clear dbuf).

It seems to me that calling the callback only makes sense for the safety checks (and this seems to be consistent with behaviour elsewhere including in the other changes in that commit (e.g. asctime_s).

I've not done a complete inspection to see if there are other cases where "normal errors" are triggering the handler, since it's possible that this is deliberate (in which case, I guess this issue raises the opposite issue 😄 ).

@jleffler
Copy link

jleffler commented Jul 11, 2022 via email

@bossmc
Copy link
Contributor Author

bossmc commented Jul 11, 2022

Thanks for the confirmation @jleffler!

I've raised #120 for the change needed to fix this issue.

@rurban
Copy link
Owner

rurban commented Jul 12, 2022

Thanks! Merged

@rurban rurban closed this as completed Jul 12, 2022
@rurban rurban added the bug label Jul 12, 2022
@rurban rurban added this to the 3.8 milestone Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants