From a50a0c5b0d2f4a409800e628c2019c5950760c76 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 23 Feb 2019 09:20:30 +0100 Subject: [PATCH] - fixed: empty strings cannot be substituted. --- src/utility/zstring.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utility/zstring.cpp b/src/utility/zstring.cpp index fa56229ad..d4ad5ec89 100644 --- a/src/utility/zstring.cpp +++ b/src/utility/zstring.cpp @@ -1039,6 +1039,7 @@ void FString::Substitute (const char *oldstr, const char *newstr) void FString::Substitute (const char *oldstr, const char *newstr, size_t oldstrlen, size_t newstrlen) { + if (oldstr == nullptr || newstr == nullptr || *oldstr == 0) return; LockBuffer(); for (size_t checkpt = 0; checkpt < Len(); ) {