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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user