wreadln: use locale width to draw masked value
authorMax Kellermann <max@musicpd.org>
Mon, 17 Sep 2018 17:48:30 +0000 (19:48 +0200)
committerMax Kellermann <max@musicpd.org>
Mon, 17 Sep 2018 17:48:30 +0000 (19:48 +0200)
`wreadln::value` is not UTF-8, after all.

src/wreadln.cxx

index a6f083e..15387aa 100644 (file)
@@ -24,7 +24,6 @@
 #include "Point.hxx"
 #include "config.h"
 #include "util/LocaleString.hxx"
-#include "util/StringUTF8.hxx"
 
 #include <string>
 
@@ -214,7 +213,7 @@ wreadln::Paint() const
        whline(w, ' ', width);
        /* print visible part of the line buffer */
        if (masked)
-               whline(w, '*', utf8_width(value.c_str() + start));
+               whline(w, '*', StringWidthMB(value.c_str() + start));
        else
                waddnstr(w, value.c_str() + start,
                         screen_to_bytes(value.c_str(), width));