summaryrefslogtreecommitdiffstats
path: root/alias.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-04-08 15:20:53 -0700
committerKevin McCarthy <kevin@8t8.us>2016-04-08 15:20:53 -0700
commita9596d5ca71e2469459879b39f4f72fb790ee69f (patch)
treeb3f12d55f17c5013bb73bfe5eee050cb77dd9505 /alias.c
parenta74f8e628157439856f282222e60fc1bb9e3f4b1 (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 'alias.c')
-rw-r--r--alias.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/alias.c b/alias.c
index cb653fd1..0cb9ebe8 100644
--- a/alias.c
+++ b/alias.c
@@ -423,6 +423,8 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen)
{
if (dry)
return -1;
+ if (l == (size_t)(-1))
+ memset (&mb, 0, sizeof (mbstate_t));
*dest++ = '_';
rv = -1;
}