return strlen(widget->buffer);
}
-static int cli_progressbar_add_string(struct cli_progressbar* p, const char* format, ...)
- __attribute__((format(printf, 2, 3)));
-
-static int cli_progressbar_add_string(struct cli_progressbar* p, const char* format, ...) {
- char* s = NULL;
- va_list args;
-
- va_start(args, format);
- int r = vasprintf(&s, format, args);
- va_end(args);
-
- if (r < 0)
- return r;
-
- return cli_progressbar_add_widget(p, cli_progressbar_string, free, 0, s);
-}
-
static ssize_t cli_progressbar_title(struct cli_progressbar* p,
struct cli_progressbar_widget* widget, unsigned int width, void* data) {
const char* title = NULL;