console/libgnt/gntutils.c

changeset 14776
f34432aa0233
parent 14539
7d5528c864a1
child 14855
84c869823944
equal deleted inserted replaced
14775:f98cb867cc0e 14776:f34432aa0233
57 { 57 {
58 int size; 58 int size;
59 int width = 0; 59 int width = 0;
60 const char *str = string; 60 const char *str = string;
61 61
62 if (len <= 0) {
63 len = g_utf8_strlen(string, -1);
64 }
65
62 while (width < len && *str) { 66 while (width < len && *str) {
63 size = g_unichar_iswide(g_utf8_get_char(str)) ? 2 : 1; 67 size = g_unichar_iswide(g_utf8_get_char(str)) ? 2 : 1;
64 if (width + size > len) 68 if (width + size > len)
65 break; 69 break;
66 str = g_utf8_next_char(str); 70 str = g_utf8_next_char(str);

mercurial