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/makesrna
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/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index b910648495b..21a3c087197 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -649,10 +649,9 @@ static void rna_Event_unicode_get(PointerRNA *ptr, char *value)
size_t len = 0;
if (event->utf8_buf[0]) {
- BLI_str_utf8_as_unicode_and_size(event->utf8_buf, &len);
- if (len > 0) {
+ if (BLI_str_utf8_as_unicode_step_or_error(event->utf8_buf, sizeof(event->utf8_buf), &len) !=
+ BLI_UTF8_ERR)
memcpy(value, event->utf8_buf, len);
- }
}
value[len] = '\0';