From bd49fe3cb0061d2cf36b6fef3f2034155595a48f Mon Sep 17 00:00:00 2001 From: Ben Payne Date: Wed, 4 Mar 2015 15:48:35 -0500 Subject: [PATCH] Don't call strncpy when src == dest This fixes an error flagged by address sanitizer --- Engine/source/gui/controls/guiTextCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/controls/guiTextCtrl.cpp b/Engine/source/gui/controls/guiTextCtrl.cpp index 1b8c8e9e0..3c1f1a8c9 100644 --- a/Engine/source/gui/controls/guiTextCtrl.cpp +++ b/Engine/source/gui/controls/guiTextCtrl.cpp @@ -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';