summaryrefslogtreecommitdiff
path: root/lib/termtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/termtable.c')
-rw-r--r--lib/termtable.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/termtable.c b/lib/termtable.c
index ddf8822853..14362e1443 100644
--- a/lib/termtable.c
+++ b/lib/termtable.c
@@ -130,6 +130,7 @@ struct ttable *ttable_new(const struct ttable_style *style)
*
* @return pointer to the first cell of allocated row
*/
+PRINTFRR(3, 0)
static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
const char *format, va_list ap)
{
@@ -435,13 +436,12 @@ char *ttable_dump(struct ttable *tt, const char *newline)
abspad -= row[j].style.border.right_on ? 1 : 0;
/* print text */
- const char *fmt;
if (row[j].style.align == LEFT)
- fmt = "%-*s";
+ pos += sprintf(&buf[pos], "%-*s", abspad,
+ row[j].text);
else
- fmt = "%*s";
-
- pos += sprintf(&buf[pos], fmt, abspad, row[j].text);
+ pos += sprintf(&buf[pos], "%*s", abspad,
+ row[j].text);
/* print right padding */
for (int k = 0; k < row[j].style.rpad; k++)