--- lbbs/src/screen.c 2025/06/16 01:36:56 1.97 +++ lbbs/src/screen.c 2025/06/17 02:06:48 1.99 @@ -14,6 +14,8 @@ * * ***************************************************************************/ +#define _POSIX_C_SOURCE 200809L + #include "screen.h" #include "bbs.h" #include "common.h" @@ -24,6 +26,7 @@ #include "file_loader.h" #include #include +#include #include #include #include @@ -32,9 +35,6 @@ #include #include -#define _POSIX_C_SOURCE 200809L -#include - #define ACTIVE_BOARD_HEIGHT 8 #define STR_TOP_LEFT_MAX_LEN 40 @@ -431,7 +431,7 @@ int display_data(const void *p_data, lon break; } - BBS_last_access_tm = time(0); + BBS_last_access_tm = time(NULL); } continue; @@ -565,7 +565,7 @@ int show_bottom(const char *msg) len_username = (int)strnlen(BBS_username, sizeof(BBS_username)); - time_online = time(0) - BBS_login_tm; + time_online = time(NULL) - BBS_login_tm; tm_online = gmtime(&time_online); if (tm_online->tm_mday > 1) { @@ -612,10 +612,10 @@ int show_active_board() } } - if (time(0) - t_last_show >= 10) + if (time(NULL) - t_last_show >= 10) { line_last = line_current; - t_last_show = time(0); + t_last_show = time(NULL); } else {