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 <campbell@blender.org>2022-04-07 08:43:23 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:31:59 +0300
commitcdd4ef7d6ad6db6a8ca70c00915df7aa24fa74c6 (patch)
treefa639cdffd037dea94450c12ad5587b639c4a146 /source/blender/editors/space_text
parent32681739c83433bb48d90d3698f289dab91eaab6 (diff)
Cleanup: pass the buffer length into `txt_insert_buf`
Also remove redundant NULL check.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c3
-rw-r--r--source/blender/editors/space_text/text_ops.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index 55873740491..54735a4d481 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -267,7 +267,8 @@ static void confirm_suggestion(Text *text)
// for (i = 0; i < skipleft; i++)
// txt_move_left(text, 0);
BLI_assert(memcmp(sel->name, &line[i], over) == 0);
- txt_insert_buf(text, sel->name + over);
+ const char *buf = sel->name + over;
+ txt_insert_buf(text, buf, strlen(buf));
// for (i = 0; i < skipleft; i++)
// txt_move_right(text, 0);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index d4aac8dd57f..3f1483bbd03 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -921,7 +921,7 @@ static int text_paste_exec(bContext *C, wmOperator *op)
buf = new_buf;
}
- txt_insert_buf(text, buf);
+ txt_insert_buf(text, buf, buf_len);
text_update_edited(text);
MEM_freeN(buf);
@@ -3587,7 +3587,7 @@ static int text_find_and_replace(bContext *C, wmOperator *op, short mode)
if (found) {
if (mode == TEXT_REPLACE) {
ED_text_undo_push_init(C);
- txt_insert_buf(text, st->replacestr);
+ txt_insert_buf(text, st->replacestr, strlen(st->replacestr));
if (text->curl && text->curl->format) {
MEM_freeN(text->curl->format);
text->curl->format = NULL;
@@ -3671,7 +3671,7 @@ static int text_replace_all(bContext *C)
ED_text_undo_push_init(C);
do {
- txt_insert_buf(text, st->replacestr);
+ txt_insert_buf(text, st->replacestr, strlen(st->replacestr));
if (text->curl && text->curl->format) {
MEM_freeN(text->curl->format);
text->curl->format = NULL;