Handle printing NULL correctly in table display
Treat this value as the empty string. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
930e93b892
commit
56f821b72a
1 changed files with 3 additions and 0 deletions
|
@ -500,6 +500,9 @@ static void table_print_line(const alpm_list_t *line, short col_padding,
|
|||
}
|
||||
|
||||
value = curcell->data;
|
||||
if(!value) {
|
||||
value = "";
|
||||
}
|
||||
/* silly printf requires padding size to be an int */
|
||||
cell_padding = (int)widths[i] - (int)string_length(value);
|
||||
if(cell_padding < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue