diff options
author | Kevin McCarthy <kevin@8t8.us> | 2016-04-08 15:20:53 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2016-04-08 15:20:53 -0700 |
commit | a9596d5ca71e2469459879b39f4f72fb790ee69f (patch) | |
tree | b3f12d55f17c5013bb73bfe5eee050cb77dd9505 /curs_lib.c | |
parent | a74f8e628157439856f282222e60fc1bb9e3f4b1 (diff) |
Reset mbstate for other mbrtowc() calls returning -1
Continue the cleanup started in changesets c8c76a6a1e61 and
a3450fd50d11. In those changesets, a bug was occurring due to the
mbstate not being reset when mbrtowc() returned -1.
This patch fixes other callers of mbrtowc() to reset mbstate when it
returns -1.
Diffstat (limited to 'curs_lib.c')
-rw-r--r-- | curs_lib.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1034,6 +1034,8 @@ int mutt_strwidth (const char *s) { if (k == (size_t)(-1) || k == (size_t)(-2)) { + if (k == (size_t)(-1)) + memset (&mbstate, 0, sizeof (mbstate)); k = (k == (size_t)(-1)) ? 1 : n; wc = replacement_char (); } |