Use strtok_r when wrapping chat text

This commit is contained in:
Johannes Findeisen 2026-11-30 00:00:15 +01:00
commit 676b839426

4
irc9.c
View file

@ -2507,7 +2507,9 @@ static void push_wrapped(char **rows, int *nr, int maxrows, const char *s, int w
int curvis = 0;
cur[0] = 0;
for (char *tok = strtok(copy, " \t"); tok; tok = strtok(NULL, " \t")) {
char *save = NULL;
for (char *tok = strtok_r(copy, " \t", &save); tok;
tok = strtok_r(NULL, " \t", &save)) {
int tlvis = ircfmt_vislen(tok);
size_t tlbytes = strlen(tok);
if (curvis == 0) {