summaryrefslogtreecommitdiff
path: root/ui/cli/tap-iostat.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-07-11 09:40:44 +0000
committerGuy Harris <guy@alum.mit.edu>2013-07-11 09:40:44 +0000
commit88a1a0249b0be78fb059f1df24eca75863ca7d77 (patch)
treecf718c526534a3b5a682e23c5d480575ec7728db /ui/cli/tap-iostat.c
parent97456cde01f374cbb2e957400e9b4db5990015a4 (diff)
downloadwireshark-88a1a0249b0be78fb059f1df24eca75863ca7d77.tar.gz
Get rid of an unused variable.
Don't nest g_strconcat() calls: g_strconcat(a, g_strconcat(b, c, NULL), NULL) is equivalent to g_strconcat(a, b, c, NULL). (And g_strconcat(b, c) is incorrect - you need a NULL at the end of the list.) Checking whether a pointer is "> 0" is useful only in platform-dependent situations or if you're doing a really greasy hack such as stuffing a flag into the uppermost bit of the pointer; the test should just check whether the pointer is null or not. svn path=/trunk/; revision=50500
Diffstat (limited to 'ui/cli/tap-iostat.c')
-rw-r--r--ui/cli/tap-iostat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c
index bc15e5e38e..61f6122648 100644
--- a/ui/cli/tap-iostat.c
+++ b/ui/cli/tap-iostat.c
@@ -544,7 +544,7 @@ iostat_draw(void *arg)
int val_mag; /* The magnitude of the max value in this column */
char *spaces, *spaces_s, *filler_s=NULL, **fmts, *fmt=NULL;
const char *filter;
- static gchar dur_mag_s[3], invl_mag_s[3], invl_prec_s[3], fr_mag_s[3], val_mag_s[3], *invl_fmt, *full_fmt;
+ static gchar dur_mag_s[3], invl_prec_s[3], fr_mag_s[3], val_mag_s[3], *invl_fmt, *full_fmt;
io_stat_item_t *mit, **stat_cols, *item, **item_in_column;
gboolean last_row=FALSE;
io_stat_t *iot;
@@ -996,7 +996,8 @@ iostat_draw(void *arg)
g_free(full_fmt);
g_snprintf(dur_mag_s, 3, "%u", maxw);
full_fmt = g_strconcat( dur_mag==1 ? "| " : "| ",
- invl_fmt, " <> ", g_strconcat("%-", dur_mag_s, "s|"), NULL);
+ invl_fmt, " <> ", "%-",
+ dur_mag_s, "s|", NULL);
printf(full_fmt, (guint32)(t/1000000ULL), "Dur");
} else {
printf(full_fmt, (guint32)(t/1000000ULL),
@@ -1370,7 +1371,7 @@ iostat_init(const char *optarg, void* userdata _U_)
invl_len = (int)(intv_end - invl_start);
invl_start = g_strstr_len(invl_start, invl_len, ".");
- if (invl_start > 0) {
+ if (invl_start != NULL) {
invl_len = (int)(intv_end - invl_start - 1);
if (invl_len)
io->invl_prec = MIN(invl_len, 6);