msvcrt: Implement asctime_s.
This commit is contained in:
parent
66db270d22
commit
35722cb4ce
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue