mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Don't call strncpy when src == dest
This fixes an error flagged by address sanitizer
This commit is contained in:
parent
eabff49a6a
commit
bd49fe3cb0
1 changed files with 1 additions and 1 deletions
|
|
@ -188,7 +188,7 @@ void GuiTextCtrl::setText(const char *txt)
|
||||||
if( !mProfile )
|
if( !mProfile )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (txt)
|
if (txt && txt != mText)
|
||||||
dStrncpy(mText, (UTF8*)txt, MAX_STRING_LENGTH);
|
dStrncpy(mText, (UTF8*)txt, MAX_STRING_LENGTH);
|
||||||
mText[MAX_STRING_LENGTH] = '\0';
|
mText[MAX_STRING_LENGTH] = '\0';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue