1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +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) END OBJ(battery_bar, 0)
char bat[64]; char bat[64];
if (arg) { if (arg) {
arg = scan_bar(obj, arg, 100);
sscanf(arg, "%63s", bat); sscanf(arg, "%63s", bat);
} else { } else {
strcpy(bat, "BAT0"); strcpy(bat, "BAT0");
} }
scan_bar(obj, bat, 100);
obj->data.s = strndup(bat, text_buffer_size); obj->data.s = strndup(bat, text_buffer_size);
obj->callbacks.barval = &get_battery_perct_bar; obj->callbacks.barval = &get_battery_perct_bar;
obj->callbacks.free = &gen_free_opaque; obj->callbacks.free = &gen_free_opaque;