mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Meter: restore non-wide-character build
Use mbstowcs() only with wide ncurses support. Closes: #401
This commit is contained in:
parent
61b8e31b41
commit
79970f05f3
4
Meter.c
4
Meter.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user