format-table: don't hit assert if column got less width than it asked for

If one field in a specific column has a maximum size limit, other fields
in the same column might affected by it and get less than they asked
for. Let's make sure we can handle this, and don't assert on this
because surprisingly we got less than what we asked for.
This commit is contained in:
Lennart Poettering
2021-02-09 15:05:25 +01:00
parent 0f15cb2243
commit 2cd9f773e2
+1 -2
View File
@@ -1993,8 +1993,7 @@ int table_print(Table *t, FILE *f) {
if (width[j] < minimum_width[j])
width[j] = minimum_width[j];
assert(width[j] >= requested_width[j]);
delta = width[j] - requested_width[j];
delta = LESS_BY(width[j], requested_width[j]);
/* Subtract what we just added from the rest */
if (extra > delta)