Nettrace: Fix fix to calculation of changetime
A long time ago, in a galaxy far far away, C had arithmetic/logical- plus-assignment operators, so that a = a {op} x; could be written as a ={op} x; Unfortunately, if {op} is -, that meant that you could have, for example: a =- 17; which could be interpreted as a = -17; so they changed the operators to be a {op}= x; I.e., if you want to subtract 1000 from a variable, do elapsed_ms -= 1000; not elapsed_ms =- 1000;
This commit is contained in:
parent
79bf1f7d99
commit
e02229250d
|
@ -1076,7 +1076,7 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_
|
|||
guint start_ms = start_time.nsecs / 1000000;
|
||||
guint elapsed_ms = start_ms + ms;
|
||||
if (elapsed_ms > 1000) {
|
||||
elapsed_ms =- 1000;
|
||||
elapsed_ms -= 1000;
|
||||
second++;
|
||||
}
|
||||
packet_time.secs = start_time.secs + second;
|
||||
|
|
Loading…
Reference in New Issue