diff --git a/stl/src/tzdb.cpp b/stl/src/tzdb.cpp index 8441519437..58f5ddd37d 100644 --- a/stl/src/tzdb.cpp +++ b/stl/src/tzdb.cpp @@ -200,6 +200,7 @@ namespace { const auto _Input_as_wchar = reinterpret_cast(_Input); const auto _Count_result = __std_fs_convert_wide_to_narrow(_Code_page, _Input_as_wchar, _Input_len, nullptr, 0); if (_Count_result._Err != __std_win_error::_Success) { + SetLastError(static_cast(_Count_result._Err)); _Err = __std_tzdb_error::_Win_error; return nullptr; } @@ -214,6 +215,7 @@ namespace { const auto _Result = __std_fs_convert_wide_to_narrow(_Code_page, _Input_as_wchar, _Input_len, _Data.get(), _Count_result._Len); if (_Result._Err != __std_win_error::_Success) { + SetLastError(static_cast(_Result._Err)); _Err = __std_tzdb_error::_Win_error; return nullptr; }