--- lbbs/src/editor.c 2025/06/16 05:35:05 1.25 +++ lbbs/src/editor.c 2025/06/17 02:06:48 1.27 @@ -14,6 +14,8 @@ * * ***************************************************************************/ +#define _POSIX_C_SOURCE 200809L + #include "editor.h" #include "bbs.h" #include "io.h" @@ -24,8 +26,6 @@ #include #include #include - -#define _POSIX_C_SOURCE 200809L #include #define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m" @@ -138,7 +138,7 @@ EDITOR_DATA *editor_data_load(const char p_data_line[current_data_line_length] = '\0'; } - bzero(p_editor_data->p_display_lines + p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total); + memset(p_editor_data->p_display_lines + p_editor_data->display_line_total, 0, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total); return p_editor_data; } @@ -708,7 +708,7 @@ int editor_display(EDITOR_DATA *p_editor if ((ch >= 32 && ch < 127) || (ch > 127 && ch <= 255 && str_len == 2) || // Printable character or GBK ch == CR || ch == KEY_ESC) // Special character { - BBS_last_access_tm = time(0); + BBS_last_access_tm = time(NULL); if (str_len == 0) // ch >= 32 && ch < 127 { @@ -784,7 +784,7 @@ int editor_display(EDITOR_DATA *p_editor } else if (ch == KEY_DEL || ch == BACKSPACE) // Del { - BBS_last_access_tm = time(0); + BBS_last_access_tm = time(NULL); if (ch == BACKSPACE) { @@ -1061,7 +1061,7 @@ int editor_display(EDITOR_DATA *p_editor break; } - BBS_last_access_tm = time(0); + BBS_last_access_tm = time(NULL); if (input_ok) {