/[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.33 by sysadm, Mon May 5 11:11:06 2025 UTC Revision 1.34 by sysadm, Mon May 5 14:27:57 2025 UTC
# Line 216  int display_file(const char *filename) Line 216  int display_file(const char *filename)
216  {  {
217          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
218          FILE *fin;          FILE *fin;
219          int i;          size_t i;
220    
221          if ((fin = fopen(filename, "r")) == NULL)          if ((fin = fopen(filename, "r")) == NULL)
222          {          {
# Line 245  int display_file_ex(const char *filename Line 245  int display_file_ex(const char *filename
245          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
246          int ch = 0;          int ch = 0;
247          int input_ok, line, max_lines;          int input_ok, line, max_lines;
248          long int c_line_current = 0, c_line_total = 0;          long int c_line_current = 0;
249            long int c_line_total = 0;
250          FILE *fin;          FILE *fin;
251          long *p_line_offsets;          long *p_line_offsets;
252          int len;          long int len;
253          int percentile;          long int percentile;
254          int loop = 1;          int loop = 1;
255    
256          if ((fin = fopen(filename, "r")) == NULL)          if ((fin = fopen(filename, "r")) == NULL)
# Line 398  int display_file_ex(const char *filename Line 399  int display_file_ex(const char *filename
399                          log_error("Error length exceeds buffer size: %d\n", len);                          log_error("Error length exceeds buffer size: %d\n", len);
400                          len = LINE_BUFFER_LEN - 1;                          len = LINE_BUFFER_LEN - 1;
401                  }                  }
402                  if (fgets(buffer, len + 1, fin) == NULL)                  if (fgets(buffer, (int)len + 1, fin) == NULL)
403                  {                  {
404                          log_error("Reach EOF\n");                          log_error("Reach EOF\n");
405                          break;                          break;
# Line 420  int show_top(char *status) Line 421  int show_top(char *status)
421  {  {
422          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
423    
424          str_space(buffer, 20 - strnlen(BBS_current_section_name, sizeof(BBS_current_section_name)));          str_space(buffer, 20 - (int)strnlen(BBS_current_section_name, sizeof(BBS_current_section_name)));
425    
426          moveto(1, 0);          moveto(1, 0);
427          clrtoeol();          clrtoeol();
# Line 440  int show_bottom(char *msg) Line 441  int show_bottom(char *msg)
441          struct tm *tm_online;          struct tm *tm_online;
442    
443          get_time_str(str_time, sizeof(str_time));          get_time_str(str_time, sizeof(str_time));
444          str_space(buffer, 33 - strnlen(BBS_username, sizeof(BBS_username)));          str_space(buffer, 33 - (int)strnlen(BBS_username, sizeof(BBS_username)));
445    
446          time_online = time(0) - BBS_login_tm;          time_online = time(0) - BBS_login_tm;
447          tm_online = gmtime(&time_online);          tm_online = gmtime(&time_online);
# Line 463  int show_active_board() Line 464  int show_active_board()
464          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
465          FILE *fin;          FILE *fin;
466          static int line;          static int line;
467          int len;          unsigned int len;
468          int end_of_line;          int end_of_line;
469    
470          clrline(3, 2 + ACTIVE_BOARD_HEIGHT);          clrline(3, 2 + ACTIVE_BOARD_HEIGHT);


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

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