editcap: ifix time shift with useconds carry
time shift to a whole number of seconds need to carry the seconds Change-Id: I188d915bca8f86a2cc19fc603bf472f461e8beea Reviewed-on: https://code.wireshark.org/review/28372 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
590d0a483e
commit
7728a336ed
|
@ -1539,7 +1539,7 @@ main(int argc, char *argv[])
|
|||
temp_rec = *rec;
|
||||
temp_rec.ts.secs = previous_time.secs + strict_time_adj.tv.secs;
|
||||
temp_rec.ts.nsecs = previous_time.nsecs;
|
||||
if (temp_rec.ts.nsecs + strict_time_adj.tv.nsecs > ONE_BILLION) {
|
||||
if (temp_rec.ts.nsecs + strict_time_adj.tv.nsecs >= ONE_BILLION) {
|
||||
/* carry */
|
||||
temp_rec.ts.secs++;
|
||||
temp_rec.ts.nsecs += strict_time_adj.tv.nsecs - ONE_BILLION;
|
||||
|
@ -1559,7 +1559,7 @@ main(int argc, char *argv[])
|
|||
temp_rec = *rec;
|
||||
temp_rec.ts.secs = previous_time.secs + strict_time_adj.tv.secs;
|
||||
temp_rec.ts.nsecs = previous_time.nsecs;
|
||||
if (temp_rec.ts.nsecs + strict_time_adj.tv.nsecs > ONE_BILLION) {
|
||||
if (temp_rec.ts.nsecs + strict_time_adj.tv.nsecs >= ONE_BILLION) {
|
||||
/* carry */
|
||||
temp_rec.ts.secs++;
|
||||
temp_rec.ts.nsecs += strict_time_adj.tv.nsecs - ONE_BILLION;
|
||||
|
@ -1592,7 +1592,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
temp_rec.ts.nsecs -= time_adj.tv.nsecs;
|
||||
} else { /* add */
|
||||
if (temp_rec.ts.nsecs + time_adj.tv.nsecs > ONE_BILLION) {
|
||||
if (temp_rec.ts.nsecs + time_adj.tv.nsecs >= ONE_BILLION) {
|
||||
/* carry */
|
||||
temp_rec.ts.secs++;
|
||||
temp_rec.ts.nsecs += time_adj.tv.nsecs - ONE_BILLION;
|
||||
|
|
Loading…
Reference in New Issue