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

Fix date_format crash on Windows #279

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Mar 29, 2023

Closes #211

strftime crashes on Windows if it receives invalid parameters, so we need to manually validate the format parameter to avoid crashing.

See:
https://stackoverflow.com/a/64328476
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=msvc-170#remarks
https://en.cppreference.com/w/c/chrono/strftime

@tobil4sk tobil4sk force-pushed the fix/date_format_crash branch from 7ae9d5a to f4df65e Compare April 1, 2023 16:04
tobil4sk added 2 commits July 2, 2024 15:46
On windows, strftime causes a crash if the format is invalid, so we have
to do a manual check
@tobil4sk tobil4sk force-pushed the fix/date_format_crash branch from f4df65e to 78155ef Compare July 2, 2024 14:46
@Simn Simn merged commit c580c36 into HaxeFoundation:master Jul 2, 2024
14 checks passed
@tobil4sk tobil4sk deleted the fix/date_format_crash branch July 4, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exceptions on windows not catched
2 participants