Treat erf_timestamp_t's as integral values.

That's what they are, and that's how other code in erf_open() treats
them; just use assignment to initialize prevts and to set prevts to ts.

Maybe this will keep the Clang static analyzer from calling prevts a
garbage value when compared with ts.

Change-Id: I2ee2376ced5c3efa6beab34276009a3177c94416
Reviewed-on: https://code.wireshark.org/review/32455
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2019-03-17 09:19:12 -07:00
parent 654110515d
commit a3de3fbec9
1 changed files with 2 additions and 2 deletions

View File

@ -367,7 +367,7 @@ extern wtap_open_return_val erf_open(wtap *wth, int *err, gchar **err_info)
guint erf_ext_header_size = (guint)sizeof(erf_ext_header);
guint8 type;
memset(&prevts, 0, sizeof(prevts));
prevts = 0;
/* number of records to scan before deciding if this really is ERF */
if ((s = getenv("ERF_RECORDS_TO_CHECK")) != NULL) {
@ -455,7 +455,7 @@ extern wtap_open_return_val erf_open(wtap *wth, int *err, gchar **err_info)
return WTAP_OPEN_NOT_MINE;
}
memcpy(&prevts, &ts, sizeof(prevts));
prevts = ts;
/* Read over the extension headers */
type = header.type;