Don't call strncpy when src == dest

This fixes an error flagged by address sanitizer
This commit is contained in:
Ben Payne 2015-03-04 15:48:35 -05:00
parent eabff49a6a
commit bd49fe3cb0

View file

@ -188,7 +188,7 @@ void GuiTextCtrl::setText(const char *txt)
if( !mProfile )
return;
if (txt)
if (txt && txt != mText)
dStrncpy(mText, (UTF8*)txt, MAX_STRING_LENGTH);
mText[MAX_STRING_LENGTH] = '\0';