[BACK]Return to utf8.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/utf8.c between version 1.50 and 1.51

version 1.50, 2020/06/02 11:29:00 version 1.51, 2020/06/02 17:17:44
Line 162 
Line 162 
                 m.data[1] = (offset >> 8) & 0xff;                  m.data[1] = (offset >> 8) & 0xff;
                 m.data[2] = (offset >> 16);                  m.data[2] = (offset >> 16);
         }          }
         *uc = m.uc;          *uc = htonl(m.uc);
         return (UTF8_DONE);          return (UTF8_DONE);
   
 fail:  fail:
         if (ud->width == 1)          if (ud->width == 1)
                 *uc = utf8_space1.uc;                  *uc = htonl(utf8_space1.uc);
         else          else
                 *uc = utf8_space2.uc;                  *uc = htonl(utf8_space2.uc);
         return (UTF8_ERROR);          return (UTF8_ERROR);
 }  }
   
Line 177 
Line 177 
 void  void
 utf8_to_data(utf8_char uc, struct utf8_data *ud)  utf8_to_data(utf8_char uc, struct utf8_data *ud)
 {  {
         union utf8_map           m = { .uc = uc };          union utf8_map           m = { .uc = ntohl(uc) };
         struct utf8_item        *ui;          struct utf8_item        *ui;
         u_int                    offset;          u_int                    offset;
   
Line 210 
Line 210 
   
         if (width == 2)          if (width == 2)
                 m.flags |= UTF8_FLAG_WIDTH2;                  m.flags |= UTF8_FLAG_WIDTH2;
         return (m.uc);          return (htonl(m.uc));
 }  }
   
 /* Set a single character. */  /* Set a single character. */

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51