Project

General

Profile

Feature #892 ยป 0045-sdl3-Update-TTF_SizeUTF8-return-value-checking.patch

Marko Lindqvist, 09/20/2024 10:22 PM

View differences:

client/gui-sdl3/gui_string.c
w = 0;
h = 0;
while (utf8_texts[count]) {
if (TTF_SizeUTF8(pstr->font, utf8_texts[count], &ww, &hh) < 0) {
if (!TTF_SizeUTF8(pstr->font, utf8_texts[count], &ww, &hh)) {
do {
FC_FREE(utf8_texts[count]);
count++;
......
count++;
}
} else {
if (TTF_SizeUTF8(pstr->font, pstr->text, &w, &h) < 0) {
if (!TTF_SizeUTF8(pstr->font, pstr->text, &w, &h)) {
log_error("TTF_SizeUTF8() return ERROR!");
}
}
    (1-1/1)