Meter: restore non-wide-character build

Use mbstowcs() only with wide ncurses support.

Closes: #401
This commit is contained in:
Christian Göttsche 2020-12-15 12:05:20 +01:00
parent 61b8e31b41
commit 79970f05f3
1 changed files with 4 additions and 0 deletions

View File

@ -196,7 +196,11 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
// The text in the bar is right aligned;
// calculate needed padding and generate leading spaces
#ifdef HAVE_LIBNCURSESW
const int textLen = mbstowcs(NULL, buffer, 0);
#else
const int textLen = strlen(buffer);
#endif
const int padding = CLAMP(w - textLen, 0, w);
RichString_begin(bar);