summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-02-06 14:53:01 -0800
committerKevin McCarthy <kevin@8t8.us>2022-02-06 14:53:01 -0800
commit70958893f85d1ca78a7b07a446cfa78779848d1a (patch)
treed6fd9c1554765512a1709d6e6b21f0dd910b242e
parentfe3dd70504eee97cb8e6fb90b34e9f036f5845d1 (diff)
Fix mutt_paddstr() to properly filter unprintable chars.
The original version of this function had no "replacement character" functionality, so it simply directly called addnstr() to display the characters if everything was okay. Commit a080fd35 added replacement logic, similar to mutt_format_string(), but forgot to change addnstr to use the replacement character. This means garbage characters could goof up the mutt display, for things such as the subject in the compose menu. We could add calls to wcrtomb() like in mutt_format_string(), but mutt_addwch() already does this, and properly calls wcrtomb() a second time to add a shift sequence if needed.
-rw-r--r--curs_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/curs_lib.c b/curs_lib.c
index c1ae937e..38f58870 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -1518,7 +1518,7 @@ void mutt_paddstr (int n, const char *s)
{
if (w > n)
break;
- addnstr ((char *)s, k);
+ mutt_addwch (wc);
n -= w;
}
}