diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 16c84868903..b7106b7ff66 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1424,7 +1424,7 @@ @ cdecl abs(long) msvcrt.abs @ cdecl acos(double) msvcrt.acos @ cdecl asctime(ptr) msvcrt.asctime -@ stub asctime_s +@ cdecl asctime_s(ptr long ptr) msvcrt.asctime_s @ cdecl asin(double) msvcrt.asin @ cdecl atan(double) msvcrt.atan @ cdecl atan2(double double) msvcrt.atan2 diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 240b9f2acfe..03139470bc9 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -1280,7 +1280,7 @@ @ cdecl abs(long) msvcrt.abs @ cdecl acos(double) msvcrt.acos @ cdecl asctime(ptr) msvcrt.asctime -@ stub asctime_s +@ cdecl asctime_s(ptr long ptr) msvcrt.asctime_s @ cdecl asin(double) msvcrt.asin @ cdecl atan(double) msvcrt.atan @ cdecl atan2(double double) msvcrt.atan2 diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index f1fa88aa310..6856d1792d1 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -1272,7 +1272,7 @@ @ cdecl acos(double) msvcrt.acos @ cdecl -arch=x86_64 acosf(float) msvcrt.acosf @ cdecl asctime(ptr) msvcrt.asctime -@ stub asctime_s +@ cdecl asctime_s(ptr long ptr) msvcrt.asctime_s @ cdecl asin(double) msvcrt.asin @ cdecl atan(double) msvcrt.atan @ cdecl atan2(double double) msvcrt.atan2 diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 2687fd6b67c..2b6dda21aa4 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1214,7 +1214,7 @@ @ cdecl acos(double) MSVCRT_acos @ cdecl -arch=x86_64 acosf(float) MSVCRT_acosf @ cdecl asctime(ptr) MSVCRT_asctime -# stub asctime_s(ptr long ptr) +@ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s @ cdecl asin(double) MSVCRT_asin @ cdecl atan(double) MSVCRT_atan @ cdecl atan2(double double) MSVCRT_atan2 diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index bf87711cfd5..adf6a1d6a30 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -902,6 +902,31 @@ char * CDECL MSVCRT_asctime(const struct MSVCRT_tm *mstm) return data->asctime_buffer; } +/********************************************************************* + * asctime_s (MSVCRT.@) + */ +int CDECL MSVCRT_asctime_s(char* time, MSVCRT_size_t size, const struct MSVCRT_tm *mstm) +{ + char* asc; + unsigned int len; + + if (!MSVCRT_CHECK_PMT(time != NULL) || !MSVCRT_CHECK_PMT(mstm != NULL)) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + asc = MSVCRT_asctime(mstm); + len = strlen(asc) + 1; + + if(!MSVCRT_CHECK_PMT(size >= len)) { + *MSVCRT__errno() = MSVCRT_ERANGE; + return MSVCRT_ERANGE; + } + + strcpy(time, asc); + return 0; +} + /********************************************************************* * _wasctime (MSVCRT.@) */