From 0488b18f8f1d381e49105256727d02abe7ed2c4e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 26 Nov 2016 13:26:44 +0200 Subject: [PATCH] Fixed junk character(s) left after removing portion of string See http://forum.zdoom.org/viewtopic.php?t=54379 --- src/zstring.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zstring.cpp b/src/zstring.cpp index e8e867323..1999f54fe 100644 --- a/src/zstring.cpp +++ b/src/zstring.cpp @@ -397,6 +397,7 @@ void FString::Remove(size_t index, size_t remlen) if (Data()->RefCount == 1) { // Can do this in place memmove(Chars + index, Chars + index + remlen, Len() - index - remlen); + memset(Chars + Len() - remlen, 0, remlen); Data()->Len -= (unsigned)remlen; } else