Commit 27e8440c authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

table: simplify header

parent e32f06d7
......@@ -65,7 +65,6 @@ void table_header(struct table *t)
if (t->width != log_get_width())
table_resize(t, log_get_width());
char *line0 = strf("\b");
char *line1 = strf("\b\b" BOX_UD);
char *line2 = strf("\b\b" BOX_UD);
char *line3 = strf("\b");
......@@ -90,28 +89,23 @@ void table_header(struct table *t)
}
for (int j = 0; j < t->cols[i]._width + 2; j++) {
strcatf(&line0, "%s", BOX_LR);
strcatf(&line3, "%s", BOX_LR);
}
if (i == t->ncols - 1) {
strcatf(&line0, "%s", BOX_DL);
strcatf(&line3, "%s", BOX_UDL);
}
else {
strcatf(&line0, "%s", BOX_DLR);
strcatf(&line3, "%s", BOX_UDLR);
}
free(col);
}
stats("%s", line0);
info("%s", line1);
info("%s", line2);
info("%s", line3);
free(line0);
free(line1);
free(line2);
free(line3);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment