diff options
author | Kevin McCarthy <kevin@8t8.us> | 2022-02-06 14:53:01 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2022-02-06 14:53:01 -0800 |
commit | 70958893f85d1ca78a7b07a446cfa78779848d1a (patch) | |
tree | d6fd9c1554765512a1709d6e6b21f0dd910b242e | |
parent | fe3dd70504eee97cb8e6fb90b34e9f036f5845d1 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } } |