diff --git a/MiniScript-cpp/src/DateTimeUtils.cpp b/MiniScript-cpp/src/DateTimeUtils.cpp index 9c6a94b..8cf5984 100644 --- a/MiniScript-cpp/src/DateTimeUtils.cpp +++ b/MiniScript-cpp/src/DateTimeUtils.cpp @@ -34,7 +34,7 @@ static bool Match(const String s, size_t *posB, const String match) { String FormatDate(time_t t, String formatSpec) { tm dateTime; struct tm *newtime = localtime_r(&t, &dateTime); - if (errno or newtime == nullptr) return ""; // arg t too large + if (newtime == nullptr) return ""; // arg t too large const int BUFSIZE = 128; char buffer[BUFSIZE]; diff --git a/MiniScript-cpp/tests/testDateTimeDateStr.ms b/MiniScript-cpp/tests/testDateTimeDateStr.ms index 69d3176..b2ff00a 100644 --- a/MiniScript-cpp/tests/testDateTimeDateStr.ms +++ b/MiniScript-cpp/tests/testDateTimeDateStr.ms @@ -1,6 +1,7 @@ import "qa" testDateTimeDateStr = function + qa.assertEqual _dateStr(0), "2000-01-01 00:00:00" qa.assertEqual _dateStr(1e20), "" end function