fixed sefault when calling the function with null pointer

This commit is contained in:
DissolveDZ 2023-09-30 18:43:09 +02:00
parent 1639d091db
commit dc86f5e04a

View File

@ -1424,7 +1424,7 @@ int TextCopy(char *dst, const char *src)
// REQUIRES: strcmp() // REQUIRES: strcmp()
bool TextIsEqual(const char *text1, const char *text2) bool TextIsEqual(const char *text1, const char *text2)
{ {
return !strcmp(text1, text2); return text1 && text2 ? !strcmp(text1, text2) : 0;
} }
// Get a piece of a text string // Get a piece of a text string