Fix for own error in recent text3d changes

Called important function from within an assert.
This commit is contained in:
Campbell Barton 2014-01-06 14:41:33 +11:00
parent 64fc94e93f
commit 7b8e07b7d0
Notes: blender-bot 2023-02-14 11:24:00 +01:00
Referenced by issue #38052, Text object edition is broken
1 changed files with 4 additions and 2 deletions

View File

@ -1545,6 +1545,7 @@ void make_editText(Object *obedit)
{
Curve *cu = obedit->data;
EditFont *ef = cu->editfont;
int len_wchar;
if (ef == NULL) {
ef = cu->editfont = MEM_callocN(sizeof(EditFont), "editfont");
@ -1556,8 +1557,9 @@ void make_editText(Object *obedit)
}
/* Convert the original text to wchar_t */
BLI_assert(BLI_strncpy_wchar_from_utf8(ef->textbuf, cu->str, MAXTEXT + 4) == cu->len_wchar); /* length is bogus */
ef->len = cu->len_wchar;
len_wchar = BLI_strncpy_wchar_from_utf8(ef->textbuf, cu->str, MAXTEXT + 4);
BLI_assert(len_wchar == cu->len_wchar);
ef->len = len_wchar;
memcpy(ef->textbufinfo, cu->strinfo, ef->len * sizeof(CharInfo));