Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/rtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include <stdlib.h> // Required for: malloc(), free()
#include <stdio.h> // Required for: vsprintf()
#include <string.h> // Required for: strcmp(), strstr(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()]
#include <string.h> // Required for: strstr(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()]
#include <stdarg.h> // Required for: va_list, va_start(), vsprintf(), va_end() [Used in TextFormat()]
#include <ctype.h> // Required for: toupper(), tolower() [Used in TextToUpper(), TextToLower()]

Expand Down Expand Up @@ -1675,14 +1675,19 @@ int TextCopy(char *dst, const char *src)
}

// Check if two text strings are equal
// REQUIRES: strcmp()
// NOTE: Alternative implementation to strcmp(s1, s2) from C standard library
bool TextIsEqual(const char *text1, const char *text2)
{
bool result = false;

if ((text1 != NULL) && (text2 != NULL))
{
if (strcmp(text1, text2) == 0) result = true;
while ((*text1 != '\0') && (*text1 == *text2))
{
text1++;
text2++;
}
if (*text1 == *text2) result = true;
}

return result;
Expand Down
Loading