(uprnf): A print function must not change its text argument!
This commit is contained in:
parent
b5ff7e3beb
commit
1bf1b5b303
1 changed files with 12 additions and 4 deletions
|
@ -73,13 +73,21 @@ pr(char *format, ...)
|
||||||
pr_player(player, C_DATA, buf);
|
pr_player(player, C_DATA, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print UTF-8 text BUF to current player.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
uprnf(char *buf /* buf is message text */)
|
uprnf(char *buf)
|
||||||
{
|
{
|
||||||
if (!(player->flags & PF_UTF8))
|
char *p;
|
||||||
copy_utf8_to_ascii_no_funny(buf, buf);
|
|
||||||
|
|
||||||
pr_player(player, C_DATA, buf);
|
if (!(player->flags & PF_UTF8)) {
|
||||||
|
p = malloc(strlen(buf) + 1);
|
||||||
|
copy_utf8_to_ascii_no_funny(p, buf);
|
||||||
|
pr_player(player, C_DATA, p);
|
||||||
|
free(p);
|
||||||
|
} else
|
||||||
|
pr_player(player, C_DATA, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*VARARGS*/
|
/*VARARGS*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue