Use strtok_r when wrapping chat text
This commit is contained in:
parent
3adceb05eb
commit
676b839426
1 changed files with 3 additions and 1 deletions
4
irc9.c
4
irc9.c
|
|
@ -2507,7 +2507,9 @@ static void push_wrapped(char **rows, int *nr, int maxrows, const char *s, int w
|
||||||
int curvis = 0;
|
int curvis = 0;
|
||||||
cur[0] = 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);
|
int tlvis = ircfmt_vislen(tok);
|
||||||
size_t tlbytes = strlen(tok);
|
size_t tlbytes = strlen(tok);
|
||||||
if (curvis == 0) {
|
if (curvis == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue