elm_code: Fix position calculations at line end

Addresses random NULLs in content after newline
This commit is contained in:
Andy Williams 2015-04-07 23:05:47 +01:00
parent a2dd4b1176
commit 4a84ad94ba
1 changed files with 4 additions and 4 deletions

View File

@ -262,13 +262,13 @@ elm_code_line_text_position_for_column_get(Elm_Code_Line *line, unsigned int col
else
chars = line->content;
while ((unsigned int) count < column && index <= line->length)
while ((unsigned int) count < column && index <= (int) line->length)
{
unicode = eina_unicode_utf8_next_get(chars, &index);
if (unicode == 0)
break;
if (unicode == '\t')
if (unicode == 0)
return line->length + 1;
else if (unicode == '\t')
count += elm_code_text_tabwidth_at_position(count, tabstop);
else
count++;