diff --git a/src/core.cc b/src/core.cc index 88fa8ece..6de868f5 100644 --- a/src/core.cc +++ b/src/core.cc @@ -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;