Commit b1c9fda7 authored by Derrick Lyndon Pallas's avatar Derrick Lyndon Pallas

time64/ctime64_r: localtime64_r can fail

In ctime64_r, the call to localtime64_r can fail.  If we don't check for
this and then call asctime64_r, the results are garbage.
Signed-off-by: 's avatarDerrick Lyndon Pallas <derrick@pallas.us>
parent fbee194f
......@@ -806,7 +806,9 @@ char *asctime64_r( const struct TM* date, char *result ) {
char *ctime64_r( const Time64_T* time, char* result ) {
struct TM date;
localtime64_r( time, &date );
if (!localtime64_r( time, &date ))
return NULL;
return asctime64_r( &date, result );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment