Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-08-25 08:19:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-25 08:28:59 +0300
commit38630711a02e553f209ace9a8627a7a851820a2d (patch)
treec0eab96fbfc8b39ed274721c919ca39e2eedf17a /source/blender/editors/space_text
parentbe906f44c6bb51eb492ecb90dbc1e8e0bc01d1ec (diff)
BLI_string_utf8: remove unnecessary utf8 decoding functions
Remove BLI_str_utf8_as_unicode_and_size and BLI_str_utf8_as_unicode_and_size_safe. Use BLI_str_utf8_as_unicode_step instead since it takes a buffer bounds argument to prevent buffer over-reading.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index a38ed12e53b..32e455f3ac9 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -177,13 +177,12 @@ static GHash *text_autocomplete_build(Text *text)
i_pos = i_start;
while ((i_start < linep->len) &&
(!text_check_identifier_nodigit_unicode(
- BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_start], &i_pos)))) {
+ BLI_str_utf8_as_unicode_step(linep->line, linep->len, &i_pos)))) {
i_start = i_pos;
}
i_pos = i_end = i_start;
- while ((i_end < linep->len) &&
- (text_check_identifier_unicode(
- BLI_str_utf8_as_unicode_and_size_safe(&linep->line[i_end], &i_pos)))) {
+ while ((i_end < linep->len) && (text_check_identifier_unicode(BLI_str_utf8_as_unicode_step(
+ linep->line, linep->len, &i_pos)))) {
i_end = i_pos;
}