Skip to content
Snippets Groups Projects
Commit 0fbd405b authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard
Browse files

msvcrt: Use thread-safe functions in _ctime32_s.

parent 84872377
No related branches found
No related tags found
No related merge requests found
......@@ -1761,7 +1761,8 @@ char * CDECL _ctime32(const __time32_t *time)
*/
errno_t CDECL _ctime32_s(char *res, size_t len, const __time32_t *time)
{
struct tm *t;
struct tm t;
int ret;
if (!MSVCRT_CHECK_PMT( res != NULL )) return EINVAL;
if (!MSVCRT_CHECK_PMT( len >= 26 )) return EINVAL;
......@@ -1769,9 +1770,10 @@ errno_t CDECL _ctime32_s(char *res, size_t len, const __time32_t *time)
if (!MSVCRT_CHECK_PMT( time != NULL )) return EINVAL;
if (!MSVCRT_CHECK_PMT( *time > 0 )) return EINVAL;
t = _localtime32( time );
strcpy( res, asctime( t ) );
return 0;
ret = _localtime32_s( &t, time );
if (ret)
return ret;
return asctime_s( res, len, &t );
}
/*********************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment