/[LeafOK_CVS]/lbbs/src/screen.c
ViewVC logotype

Diff of /lbbs/src/screen.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.73 by sysadm, Wed May 28 07:30:23 2025 UTC Revision 1.77 by sysadm, Thu May 29 02:45:23 2025 UTC
# Line 371  int display_file_ex(const char *filename Line 371  int display_file_ex(const char *filename
371                                          max_lines = SCREEN_ROWS - 1;                                          max_lines = SCREEN_ROWS - 1;
372                                          clrline(begin_line, SCREEN_ROWS);                                          clrline(begin_line, SCREEN_ROWS);
373                                          break;                                          break;
374                                    case KEY_ESC:
375                                  case KEY_LEFT:                                  case KEY_LEFT:
376                                  case 'q':                                  case 'q':
377                                  case 'Q':                                  case 'Q':
# Line 472  int show_bottom(const char *msg) Line 473  int show_bottom(const char *msg)
473          char str_time[LINE_BUFFER_LEN];          char str_time[LINE_BUFFER_LEN];
474          time_t time_online;          time_t time_online;
475          struct tm *tm_online;          struct tm *tm_online;
476          char msg_f[21];          char msg_f[LINE_BUFFER_LEN];
477          int eol;          int eol;
478          int msg_len;          int msg_len;
479          int len;          int len;
# Line 480  int show_bottom(const char *msg) Line 481  int show_bottom(const char *msg)
481    
482          get_time_str(str_time, sizeof(str_time));          get_time_str(str_time, sizeof(str_time));
483    
484          strncpy(msg_f, msg, sizeof(msg_f) - 1);          msg_f[0] = '\0';
485          msg_f[sizeof(msg_f) - 1] = '\0';          msg_len = 0;
486            if (msg != NULL)
487          len = split_line(msg_f, 20, &eol, &msg_len);          {
488          msg_f[len] = '\0';                  strncpy(msg_f, msg, sizeof(msg_f) - 1);
489                    msg_f[sizeof(msg_f) - 1] = '\0';
490                    len = split_line(msg_f, 23, &eol, &msg_len);
491                    msg_f[len] = '\0';
492            }
493    
494          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));
495    
# Line 493  int show_bottom(const char *msg) Line 498  int show_bottom(const char *msg)
498    
499          moveto(SCREEN_ROWS, 0);          moveto(SCREEN_ROWS, 0);
500          clrtoeol();          clrtoeol();
501          prints("\033[1;44;33m[\033[36m%s\033[33m]%*s%*s帐号[\033[36m%s\033[33m]"          prints("\033[1;44;33m时间[\033[36m%s\033[33m]%s%*s \033[33m帐号[\033[36m%s\033[33m]"
502                     "[\033[36m%1d\033[33m天\033[36m%2d\033[33m时\033[36m%2d\033[33m分]\033[m",                     "[\033[36m%1d\033[33m天\033[36m%2d\033[33m时\033[36m%2d\033[33m分]\033[m",
503                     str_time, 21, msg_f, 9 - len_username, "", BBS_username,                     str_time, msg_f, 35 - msg_len - len_username, "", BBS_username,
504                     tm_online->tm_mday - 1, tm_online->tm_hour, tm_online->tm_min);                     tm_online->tm_mday - 1, tm_online->tm_hour, tm_online->tm_min);
505    
506          return 0;          return 0;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1