diff --git a/src/conky.cc b/src/conky.cc index d55bff54..80b5fbef 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -746,7 +746,7 @@ void human_readable(long long num, char *buf, int size) { float fnum; int precision; int width; - const char *format; + static const char *const format = "%.*f%.1s"; /* Possibly just output as usual, for example for stdout usage */ if (!format_human_readable.get(*state)) { @@ -755,10 +755,8 @@ void human_readable(long long num, char *buf, int size) { } if (short_units.get(*state)) { width = 5; - format = "%.*f%.1s"; } else { width = 7; - format = "%.*f%-3s"; } if (llabs(num) < 1000LL) {