diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index d4d1de1..dbfb45a 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -363852,11 +363852,10 @@ const char *font_wrap(const char *text, float max_width) { array(char*) words = strsplit(text, " "); static __thread int slot = 0; - static __thread char *buf[16] = {0}; + static __thread char *buf[16][FONT_MAX_STRING_LEN] = {0}; int len = strlen(text) + array_count(words); slot = (slot+1) % 16; - buf[slot] = REALLOC(buf[slot], len+1); memset(buf[slot], 0, len+1); char *out = buf[slot]; diff --git a/engine/split/v4k_font.c b/engine/split/v4k_font.c index f6d97e7..72eff70 100644 --- a/engine/split/v4k_font.c +++ b/engine/split/v4k_font.c @@ -2295,11 +2295,10 @@ const char *font_wrap(const char *text, float max_width) { array(char*) words = strsplit(text, " "); static __thread int slot = 0; - static __thread char *buf[16] = {0}; + static __thread char *buf[16][FONT_MAX_STRING_LEN] = {0}; int len = strlen(text) + array_count(words); slot = (slot+1) % 16; - buf[slot] = REALLOC(buf[slot], len+1); memset(buf[slot], 0, len+1); char *out = buf[slot]; diff --git a/engine/v4k.c b/engine/v4k.c index 5df5a75..973630b 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -10993,11 +10993,10 @@ const char *font_wrap(const char *text, float max_width) { array(char*) words = strsplit(text, " "); static __thread int slot = 0; - static __thread char *buf[16] = {0}; + static __thread char *buf[16][FONT_MAX_STRING_LEN] = {0}; int len = strlen(text) + array_count(words); slot = (slot+1) % 16; - buf[slot] = REALLOC(buf[slot], len+1); memset(buf[slot], 0, len+1); char *out = buf[slot];