Skip to content

Commit

Permalink
Fix SDL_memcmp argument mismatch in SDL_ttf.c
Browse files Browse the repository at this point in the history
Corrected the SDL_memcmp function to compare the 'string' argument instead of 'text', ensuring proper string comparison logic. This resolves potential functional issues caused by the incorrect argument usage.
  • Loading branch information
stjepano authored and slouken committed Dec 24, 2024
1 parent 3287581 commit 40219a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4317,7 +4317,7 @@ bool TTF_SetTextString(TTF_Text *text, const char *string, size_t length)
length = SDL_strlen(string);
}

if (text->text && length == SDL_strlen(text->text) && SDL_memcmp(text, text->text, length) == 0) {
if (text->text && length == SDL_strlen(text->text) && SDL_memcmp(string, text->text, length) == 0) {
return true;
}

Expand Down

0 comments on commit 40219a6

Please sign in to comment.