diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-08-29 11:31:11 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-08-29 11:54:21 +0000 |
commit | 24fd16d86553279ca3fe8f651d85cace14edfc6c (patch) | |
tree | fb090108036a44c0ff7ec776f750e8f5209bd31a /ui | |
parent | 09a6383c12bc450717df929167891c1884d541f6 (diff) |
tap-iostat.c: ensure that interval is set to its maximum value when using 0
Otherwise the statistics will be wrong if the capture duration is greater
than G_MAXINT32 and it the user specifies an interval of 0
Bug: 12778
Change-Id: I83a0f627ec0bb7c535446c17afa486835091ab8b
Reviewed-on: https://code.wireshark.org/review/17367
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/cli/tap-iostat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index 522a307efe..c23eb63bcb 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -596,9 +596,9 @@ iostat_draw(void *arg) /* The following prevents gross inaccuracies when the user specifies an interval that is greater * than the capture duration. */ - if (iot->interval > duration || iot->interval == G_MAXINT32) { + if (iot->interval > duration || iot->interval == G_MAXUINT64) { interval = duration; - iot->interval = G_MAXINT32; + iot->interval = G_MAXUINT64; } else { interval = iot->interval; } @@ -645,7 +645,7 @@ iostat_draw(void *arg) * Recalc dur_mag in case rounding has increased its magnitude */ dur_mag = magnitude((guint64)dur_secs, 5); } - if (iot->interval == G_MAXINT32) + if (iot->interval == G_MAXUINT64) interval = duration; /* Calc the width of the time interval column (incl borders and padding). */ @@ -1421,9 +1421,9 @@ iostat_init(const char *opt_arg, void *userdata _U_) io = (io_stat_t *)g_malloc(sizeof(io_stat_t)); /* If interval is 0, calculate statistics over the whole file by setting the interval to - * G_MAXINT32 */ + * G_MAXUINT64 */ if (interval_float == 0) { - io->interval = G_MAXINT32; + io->interval = G_MAXUINT64; io->invl_prec = 0; } else { /* Set interval to the number of us rounded to the nearest integer */ |