1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-12 19:06:36 +00:00

fix padding in temp_print

This commit is contained in:
Phil Sutter 2009-03-01 21:03:49 +01:00
parent ed42437dfc
commit e6a9c02d11
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
2009-03-01 2009-03-01
* Added if_updatenr * Added if_updatenr
* Rewrite human_readable() to minimise amount of padding * Rewrite human_readable() to minimise amount of padding
* Fix padding in temp_print()
2009-02-17 2009-02-17
* Added $battery_short patch, sf.net id #2300911 (thanks Swoog) * Added $battery_short patch, sf.net id #2300911 (thanks Swoog)

View File

@ -84,10 +84,11 @@ convert_temp_output(double n, enum TEMP_UNIT input_unit)
int temp_print(char *p, size_t p_max_size, double n, enum TEMP_UNIT input_unit) int temp_print(char *p, size_t p_max_size, double n, enum TEMP_UNIT input_unit)
{ {
double out, plen; int out;
size_t plen;
out = convert_temp_output(n, input_unit); out = round_to_int(convert_temp_output(n, input_unit));
plen = spaced_print(p, p_max_size, "%.lf", 5, out); plen = spaced_print(p, p_max_size, "%d", 3, out);
return !(plen >= p_max_size); return !(plen >= p_max_size);
} }