This PR is a small follow-up to #126, addressing two warnings raised by Visual Studio when compiling for Windows.
In order to address the warnings, this PR introduces a platform-specific print_timestamp function, using localtime_s instead of localtime (which led to the emission of warnings for being insecure). Furthermore, the definition of _CRT_RAND_S is moved to tinydtls.h as it initializes the global state of the rand_s function and defining it in dtls_prng_win.c was apparently too late in the compilation process.
This PR is a small follow-up to #126, addressing two warnings raised by Visual Studio when compiling for Windows.
In order to address the warnings, this PR introduces a platform-specific
print_timestamp
function, usinglocaltime_s
instead oflocaltime
(which led to the emission of warnings for being insecure). Furthermore, the definition of_CRT_RAND_S
is moved totinydtls.h
as it initializes the global state of therand_s
function and defining it indtls_prng_win.c
was apparently too late in the compilation process.