[pacman-dev] [PATCH 1/2] Handle printing NULL correctly in table display

Dan McGee dan at archlinux.org
Wed Mar 14 23:04:04 EDT 2012


Treat this value as the empty string.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 src/pacman/util.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index 7be3dc5..a96aa62 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) {
-- 
1.7.9.4



More information about the pacman-dev mailing list