/[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.31 by sysadm, Mon May 5 05:28:16 2025 UTC Revision 1.33 by sysadm, Mon May 5 11:11:06 2025 UTC
# Line 151  static int _str_input(char *buffer, int Line 151  static int _str_input(char *buffer, int
151                  {                  {
152                          if (!hz && offset + 2 > buffer_length) // No enough space for Chinese character                          if (!hz && offset + 2 > buffer_length) // No enough space for Chinese character
153                          {                          {
154                                  igetch(1); // Clear remaining input                                  igetch(1); // Cleanup remaining input
155                                  outc('\a');                                  outc('\a');
156                                  iflush();                                  iflush();
157                                  continue;                                  continue;
# Line 181  static int _str_input(char *buffer, int Line 181  static int _str_input(char *buffer, int
181                  }                  }
182          }          }
183    
         prints("\r\n");  
         iflush();  
   
184          return offset;          return offset;
185  }  }
186    
187  int str_input(char *buffer, int buffer_length, int echo_mode)  int str_input(char *buffer, int buffer_length, int echo_mode)
188  {  {
189          int offset;          int len;
190    
191            buffer[0] = '\0';
192    
193          memset(buffer, '\0', buffer_length);          len = _str_input(buffer, buffer_length, echo_mode);
194    
195          offset = _str_input(buffer, buffer_length, echo_mode);          prints("\r\n");
196            iflush();
197    
198          return offset;          return len;
199  };  };
200    
201  int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int echo_mode)  int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int echo_mode)
# Line 420  int show_top(char *status) Line 420  int show_top(char *status)
420  {  {
421          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
422    
423          str_space(buffer, 20 - strlen(BBS_current_section_name));          str_space(buffer, 20 - strnlen(BBS_current_section_name, sizeof(BBS_current_section_name)));
424    
425          moveto(1, 0);          moveto(1, 0);
426          clrtoeol();          clrtoeol();
# Line 440  int show_bottom(char *msg) Line 440  int show_bottom(char *msg)
440          struct tm *tm_online;          struct tm *tm_online;
441    
442          get_time_str(str_time, sizeof(str_time));          get_time_str(str_time, sizeof(str_time));
443          str_space(buffer, 33 - strlen(BBS_username));          str_space(buffer, 33 - strnlen(BBS_username, sizeof(BBS_username)));
444    
445          time_online = time(0) - BBS_login_tm;          time_online = time(0) - BBS_login_tm;
446          tm_online = gmtime(&time_online);          tm_online = gmtime(&time_online);


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

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