[C++ & C#] Miniscript aborts when `_dateStr` handles excessive number
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
For C++, I think adding
if (errno == EOVERFLOW) return "";
after this line should fix it: https://github.com/JoeStrout/miniscript/blob/e85ec618a6ed11eb04d02a973e42315c19d426d5/MiniScript-cpp/src/DateTimeUtils.cpp#L34
(As for C#, don't know...)
Seems like on Windows the problem was on this line (when _localtime64() returned NULL): https://github.com/JoeStrout/miniscript/blob/e85ec618a6ed11eb04d02a973e42315c19d426d5/MiniScript-cpp/src/DateTimeUtils.cpp#L16
Filed a PR
Closing thanks to PR#162.
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.