diff --git a/irc9.c b/irc9.c index 63fa3f7..8c13613 100644 --- a/irc9.c +++ b/irc9.c @@ -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) {