console/libgnt/gntutils.c

changeset 14539
7d5528c864a1
parent 14486
002fe2ca0159
child 14776
f34432aa0233
equal deleted inserted replaced
14538:ada84c622f39 14539:7d5528c864a1
40 } 40 }
41 41
42 int gnt_util_onscreen_width(const char *start, const char *end) 42 int gnt_util_onscreen_width(const char *start, const char *end)
43 { 43 {
44 int width = 0; 44 int width = 0;
45
46 if (end == NULL)
47 end = start + strlen(start);
45 48
46 while (start < end) { 49 while (start < end) {
47 width += g_unichar_iswide(g_utf8_get_char(start)) ? 2 : 1; 50 width += g_unichar_iswide(g_utf8_get_char(start)) ? 2 : 1;
48 start = g_utf8_next_char(start); 51 start = g_utf8_next_char(start);
49 } 52 }

mercurial