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

Diff of /lbbs/src/str_process.c

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

Revision 1.28 by sysadm, Sat Nov 8 08:21:31 2025 UTC Revision 1.29 by sysadm, Mon Nov 10 12:53:16 2025 UTC
# Line 72  int str_length(const char *str, int skip Line 72  int str_length(const char *str, int skip
72    
73                          if (mbstowcs(wcs, input_str, 1) == (size_t)-1)                          if (mbstowcs(wcs, input_str, 1) == (size_t)-1)
74                          {                          {
75    #ifdef _DEBUG
76                                  log_error("mbstowcs(%s) error\n", input_str);                                  log_error("mbstowcs(%s) error\n", input_str);
77    #endif
78                                    wc_len = (UTF8_fixed_width ? 2 : 1); // Fallback
79                            }
80                            else
81                            {
82                                    wc_len = (UTF8_fixed_width ? 2 : wcwidth(wcs[0]));
83                          }                          }
                         wc_len = (UTF8_fixed_width ? 2 : wcwidth(wcs[0]));  
84    
85                          i += (str_len - 1);                          i += (str_len - 1);
86                          ret += wc_len;                          ret += wc_len;
# Line 132  int split_line(const char *buffer, int m Line 138  int split_line(const char *buffer, int m
138    
139                          if (mbstowcs(wcs, input_str, 1) == (size_t)-1)                          if (mbstowcs(wcs, input_str, 1) == (size_t)-1)
140                          {                          {
141    #ifdef _DEBUG
142                                  log_error("mbstowcs(%s) error\n", input_str);                                  log_error("mbstowcs(%s) error\n", input_str);
143    #endif
144                                    wc_len = (UTF8_fixed_width ? 2 : 1); // Fallback
145                          }                          }
146                          wc_len = (UTF8_fixed_width ? 2 : wcwidth(wcs[0]));                          else
147                            {
148                                    wc_len = (UTF8_fixed_width ? 2 : wcwidth(wcs[0]));
149                            }
150    
151                          if (*p_display_len + wc_len > max_display_len)                          if (*p_display_len + wc_len > max_display_len)
152                          {                          {
153                                  break;                                  break;


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

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