Permalink
Browse files

report.c: don't try to use colum values that weren't provided

Signed-off-by: Burt P <pburt0@gmail.com>
  • Loading branch information...
bp0 authored and lpereira committed Dec 9, 2017
1 parent b5b0810 commit 96980fbf494d9c453c6b558967c90c55e41abe2d
Showing with 3 additions and 2 deletions.
  1. +3 −2 shell/report.c
View
@@ -371,7 +371,7 @@ report_text_key_value(ReportContext * ctx, gchar * key, gchar * value)
{
gint columns = report_get_visible_columns(ctx);
gchar **values;
gint i;
gint i, mc;
if (columns == 2) {
if (strlen(value))
@@ -380,10 +380,11 @@ report_text_key_value(ReportContext * ctx, gchar * key, gchar * value)
ctx->output = h_strdup_cprintf("%s\n", ctx->output, key);
} else {
values = g_strsplit(value, "|", columns);
mc = g_strv_length(values) - 1;
ctx->output = h_strdup_cprintf("%s\t", ctx->output, key);
for (i = columns - 2; i >= 0; i--) {
for (i = mc; i >= 0; i--) {
ctx->output = h_strdup_cprintf("%s\t",
ctx->output,
values[i]);

0 comments on commit 96980fb

Please sign in to comment.