diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2018-03-11 22:02:30 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2018-03-11 22:18:50 +0100 |
| commit | d0efde07da335310b2e9da3bb9a690c2123fbc5e (patch) | |
| tree | 47f4b2e3181cb45ec865a6122fbbf840f4698532 /view.c | |
| parent | fdb56b003c9e0a00ded2878b0c174a7780bb39b2 (diff) | |
| download | vis-d0efde07da335310b2e9da3bb9a690c2123fbc5e.tar.gz vis-d0efde07da335310b2e9da3bb9a690c2123fbc5e.tar.xz | |
Reset parsing state after mbrtowc(3) failure
The standard says "if an encoding error occurs ... the conversion state
is unspecified".
Diffstat (limited to 'view.c')
| -rw-r--r-- | view.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -352,6 +352,7 @@ void view_draw(View *view) { /* ok, we encountered an invalid multibyte sequence, * replace it with the Unicode Replacement Character * (FFFD) and skip until the start of the next utf8 char */ + mbstate = (mbstate_t){0}; for (len = 1; rem > len && !ISUTF8(cur[len]); len++); cell = (Cell){ .data = "\xEF\xBF\xBD", .len = len, .width = 1 }; } else if (len == (size_t)-2) { |
