mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added mbstate_t
This commit is contained in:
parent
57f9e43566
commit
516ba16627
@ -188,8 +188,10 @@ inp_get_char(char *input, int *size)
|
|||||||
|
|
||||||
// otherwise just append
|
// otherwise just append
|
||||||
} else {
|
} else {
|
||||||
|
mbstate_t state;
|
||||||
|
memset(&state, '\0', sizeof (state));
|
||||||
char bytes[5];
|
char bytes[5];
|
||||||
size_t utf_len = wcrtomb(bytes, ch, NULL);
|
size_t utf_len = wcrtomb(bytes, ch, &state);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0 ; i < utf_len; i++) {
|
for (i = 0 ; i < utf_len; i++) {
|
||||||
input[(*size)++] = bytes[i];
|
input[(*size)++] = bytes[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user