From: Hendrik Borchardt <hendrik.borchardt@gmail.com> 0 needs to be an allowed value, and negative values should not halt the program but just return EINVAL. --- dlls/msvcrt/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index b52bb872647..3e826f04bef 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1737,7 +1737,7 @@ errno_t CDECL _ctime64_s(char *res, size_t len, const __time64_t *time) if (!MSVCRT_CHECK_PMT( len >= 26 )) return EINVAL; res[0] = '\0'; if (!MSVCRT_CHECK_PMT( time != NULL )) return EINVAL; - if (!MSVCRT_CHECK_PMT( *time > 0 )) return EINVAL; + if (*time < 0) return EINVAL; ret = _localtime64_s( &t, time ); if (ret) @@ -1768,7 +1768,7 @@ errno_t CDECL _ctime32_s(char *res, size_t len, const __time32_t *time) if (!MSVCRT_CHECK_PMT( len >= 26 )) return EINVAL; res[0] = '\0'; if (!MSVCRT_CHECK_PMT( time != NULL )) return EINVAL; - if (!MSVCRT_CHECK_PMT( *time > 0 )) return EINVAL; + if (*time < 0) return EINVAL; ret = _localtime32_s( &t, time ); if (ret) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10785