From: Robert Kessl Date: Wed, 25 Jun 2014 10:33:06 +0000 (+0200) Subject: tableprinter: table_end_row now calls table_clean_row X-Git-Tag: v6.1~21 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9f4d3c8c38e3fbd0c19a8d5518f8571cb4c8a907;p=libucw.git tableprinter: table_end_row now calls table_clean_row --- diff --git a/ucw/table.c b/ucw/table.c index 53d353b9..4666395f 100644 --- a/ucw/table.c +++ b/ucw/table.c @@ -311,22 +311,20 @@ void table_append_printf(struct table *tbl, const char *fmt, ...) va_end(args); } -void table_end_row(struct table *tbl) +void table_clean_row(struct table *tbl) { - ASSERT(tbl->formatter->row_output); - tbl->formatter->row_output(tbl); memset(tbl->col_str_ptrs, 0, sizeof(char *) * tbl->column_count); mp_restore(tbl->pool, &tbl->pool_state); tbl->last_printed_col = -1; tbl->row_printing_started = 0; } -void table_clean_row(struct table *tbl) +void table_end_row(struct table *tbl) { - memset(tbl->col_str_ptrs, 0, sizeof(char *) * tbl->column_count); - mp_restore(tbl->pool, &tbl->pool_state); - tbl->last_printed_col = -1; - tbl->row_printing_started = 0; + ASSERT(tbl->formatter->row_output); + if(tbl->row_printing_started == 0) return; + tbl->formatter->row_output(tbl); + table_clean_row(tbl); } /* Construction of a cell using a fastbuf */