diff --git a/src/shared/format-table.c b/src/shared/format-table.c index 8d816f4ec6..abc4bb3651 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -966,43 +966,43 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...) { size_t w = va_arg(ap, size_t); r = table_set_minimum_width(t, last_cell, w); - break; + goto check; } case TABLE_SET_MAXIMUM_WIDTH: { size_t w = va_arg(ap, size_t); r = table_set_maximum_width(t, last_cell, w); - break; + goto check; } case TABLE_SET_WEIGHT: { unsigned w = va_arg(ap, unsigned); r = table_set_weight(t, last_cell, w); - break; + goto check; } case TABLE_SET_ALIGN_PERCENT: { unsigned p = va_arg(ap, unsigned); r = table_set_align_percent(t, last_cell, p); - break; + goto check; } case TABLE_SET_ELLIPSIZE_PERCENT: { unsigned p = va_arg(ap, unsigned); r = table_set_ellipsize_percent(t, last_cell, p); - break; + goto check; } case TABLE_SET_COLOR: { const char *c = va_arg(ap, const char*); r = table_set_color(t, last_cell, c); - break; + goto check; } case TABLE_SET_RGAP_COLOR: { const char *c = va_arg(ap, const char*); r = table_set_rgap_color(t, last_cell, c); - break; + goto check; } case TABLE_SET_BOTH_COLORS: { @@ -1015,19 +1015,19 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...) { } r = table_set_rgap_color(t, last_cell, c); - break; + goto check; } case TABLE_SET_URL: { const char *u = va_arg(ap, const char*); r = table_set_url(t, last_cell, u); - break; + goto check; } case TABLE_SET_UPPERCASE: { int u = va_arg(ap, int); r = table_set_uppercase(t, last_cell, u); - break; + goto check; } case _TABLE_DATA_TYPE_MAX: @@ -1039,9 +1039,8 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...) { assert_not_reached("Uh? Unexpected data type."); } - if (type < _TABLE_DATA_TYPE_MAX) - r = table_add_cell(t, &last_cell, type, data); - + r = table_add_cell(t, &last_cell, type, data); + check: if (r < 0) { va_end(ap); return r;