summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-15 03:18:37 +0100
committerDan McGee <dan@archlinux.org>2012-03-16 15:49:32 +0100
commit56f821b72a6b56cdcbc727515e43c16affd39f08 (patch)
tree27cb0ac282e39266d26fd17e4c75a3e0d4aa7ee2
parent930e93b8925874a3c6d3460d2c0cebcda5fc0d09 (diff)
downloadpacman-56f821b72a6b56cdcbc727515e43c16affd39f08.tar.gz
pacman-56f821b72a6b56cdcbc727515e43c16affd39f08.tar.xz
Handle printing NULL correctly in table display
Treat this value as the empty string. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--src/pacman/util.c3
1 files changed, 3 insertions, 0 deletions
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) {