table: add teble_add_string_cell()
This commit is contained in:
@@ -380,6 +380,20 @@ int table_add_cell_full(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int table_add_cell_stringf(Table *t, TableCell **ret_cell, const char *format, ...) {
|
||||
_cleanup_free_ char *buffer = NULL;
|
||||
va_list ap;
|
||||
int r;
|
||||
|
||||
va_start(ap, format);
|
||||
r = vasprintf(&buffer, format, ap);
|
||||
va_end(ap);
|
||||
if (r < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
return table_add_cell(t, ret_cell, TABLE_STRING, buffer);
|
||||
}
|
||||
|
||||
int table_dup_cell(Table *t, TableCell *cell) {
|
||||
size_t i;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user