1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-07-29 21:01:13 +03:00

WebSockCallbacks.c: replace obsolete asctime()

The asctime() function is marked as obsolete by POSIX.1-2008-
Replace with recommended strftime();

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf
2015-03-23 12:42:15 +01:00
parent 6620783911
commit 1d5124ed5e

View File

@ -148,8 +148,7 @@ static void * eventMain(void * arg) {
while (ws_ctx->runLoop) {
time_t t = time(0);
struct tm * timestr = localtime(&t);
sprintf(msg,"title %s",asctime(timestr));
strftime(msg, sizeof(msg), "title %c", timestr);
send_to_all_websockets(ctx, msg, strlen(msg));
mg_sleep(1000);