Fix up the compare chain in nstime_delta().
The first case handles the two time stamps having the same seconds value, so, in the subsequent cases, they're guaranteed not to have the same seconds value; check for b->secs < a->secs, not for b->secs <= a->secs (the two tests will always get the same value, as b->secs != a->secs), to make it clearer what's being done. Change-Id: I6d3806237dae0ea12af92ea0344a31a2c5322b12 Reviewed-on: https://code.wireshark.org/review/15325 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
9a8a454b0a
commit
ea1ba62aec
|
@ -96,7 +96,7 @@ void nstime_delta(nstime_t *delta, const nstime_t *b, const nstime_t *a )
|
|||
can never result. */
|
||||
delta->secs = 0;
|
||||
delta->nsecs = b->nsecs - a->nsecs;
|
||||
} else if (b->secs <= a->secs) {
|
||||
} else if (b->secs < a->secs) {
|
||||
/* The seconds part of b is less than the seconds part of a, so b is
|
||||
before a.
|
||||
|
||||
|
|
Loading…
Reference in New Issue