(str_utf8_offset_to_pos): change type of variable.

GString is pointless here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-12-19 21:41:53 +03:00
parent 2e33fd4fad
commit 247d092217

View File

@ -901,12 +901,12 @@ str_utf8_offset_to_pos (const char *text, size_t length)
else
{
int result;
GString *buffer;
char *buffer;
buffer = g_string_new (text);
str_utf8_fix_string (buffer->str);
result = g_utf8_offset_to_pointer (buffer->str, length) - buffer->str;
g_string_free (buffer, TRUE);
buffer = g_strdup (text);
str_utf8_fix_string (buffer);
result = g_utf8_offset_to_pointer (buffer, length) - buffer;
g_free (buffer);
return result;
}
}