1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00

Bugfix: battery_bar should also work without argument

This commit is contained in:
Nikolas Garofil 2010-04-11 19:13:14 +02:00
parent 34f3547c0d
commit 15326c502c

View File

@ -318,11 +318,11 @@ struct text_object *construct_text_object(char *s, const char *arg, long
END OBJ(battery_bar, 0)
char bat[64];
if (arg) {
arg = scan_bar(obj, arg, 100);
sscanf(arg, "%63s", bat);
} else {
strcpy(bat, "BAT0");
}
scan_bar(obj, bat, 100);
obj->data.s = strndup(bat, text_buffer_size);
obj->callbacks.barval = &get_battery_perct_bar;
obj->callbacks.free = &gen_free_opaque;