diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:49 -0600 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:49 -0600 |
commit | 00831e690c4581ee8f0f92902ebdb75304bde817 (patch) | |
tree | 55a37b9cc5d60ad047631ffb39d2f822a22d6d39 /shell/report.c | |
parent | d95f107ef2b9e82c341060be0def97d7bfa430b9 (diff) | |
parent | 09fcc751ef158898c315ebc9299a0fa3a722d914 (diff) |
Update upstream source from tag 'upstream/0.5.1+git20180227'
Update to upstream version '0.5.1+git20180227'
with Debian dir 7ca675e2ccb4367b7cc5b255a36b5173afaf9d2c
Diffstat (limited to 'shell/report.c')
-rw-r--r-- | shell/report.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/shell/report.c b/shell/report.c index 135dfd9b..6abb03a0 100644 --- a/shell/report.c +++ b/shell/report.c @@ -300,7 +300,7 @@ report_html_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) { ctx->output = h_strdup_cprintf("<tr><td class=\"field\">%s</td>" @@ -309,10 +309,11 @@ report_html_key_value(ReportContext * ctx, gchar * key, gchar * value) key, value); } else { values = g_strsplit(value, "|", columns); + mc = g_strv_length(values) - 1; ctx->output = h_strdup_cprintf("\n<tr>\n<td class=\"field\">%s</td>", ctx->output, key); - for (i = columns - 2; i >= 0; i--) { + for (i = mc; i >= 0; i--) { ctx->output = h_strdup_cprintf("<td class=\"value\">%s</td>", ctx->output, values[i]); @@ -371,7 +372,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 +381,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]); |