Allow for empty replacement string (#1178)

This commit is contained in:
Benjamin Stigsen 2020-04-05 22:42:59 +02:00 committed by GitHub
parent 90fb53bccc
commit 2d6303e9fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1180,7 +1180,7 @@ const char *TextSubtext(const char *text, int position, int length)
char *TextReplace(char *text, const char *replace, const char *by)
{
// Sanity checks and initialization
if (!text || !replace || !by || by[0] == '\0') return NULL;
if (!text || !replace || !by) return NULL;
char *result;