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

[C++ & C#] Miniscript aborts when _dateStr handles excessive number #160

Open
Withered-Flower-0422 opened this issue Jul 14, 2024 · 4 comments

Comments

@Withered-Flower-0422
Copy link

In cmd:

> _dateStr 1e20
PS C:\Users\13390>  // MiniScript aborts

In MM:

]_dateStr 1e14  // null
]_dateStr 1e15
7909-01-14 12:55:42  // wrong date
]_dateStr 1e16
2634-12-20 03:40:52  // wrong date
@marcgurevitx
Copy link
Contributor

For C++, I think adding

if (errno == EOVERFLOW) return "";

after this line should fix it:

localtime_r(&t, &dateTime);

(As for C#, don't know...)

@marcgurevitx
Copy link
Contributor

Seems like on Windows the problem was on this line (when _localtime64() returned NULL):

*buf = *_localtime64(timer);

Filed a PR

@JoeStrout
Copy link
Owner

Closing thanks to PR#162.

@JoeStrout
Copy link
Owner

Oops, that was a mistake. Meant to close #164. This one needs to stay open until we've addressed the same thing in the C# code.

@JoeStrout JoeStrout reopened this Jul 28, 2024
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

No branches or pull requests

3 participants