From 56f821b72a6b56cdcbc727515e43c16affd39f08 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 14 Mar 2012 22:18:37 -0400 Subject: Handle printing NULL correctly in table display Treat this value as the empty string. Signed-off-by: Dan McGee --- src/pacman/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pacman/util.c b/src/pacman/util.c index c5f7a3bc..ef6de6bf 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -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) { -- cgit v1.2.3-70-g09d2