valid_but_empty_file is a Boolean, so declare it as such.

If it's either going to be -1 or 1, and any value > 0 is "valid but
empty", that's just a Boolean, with -1 corresponding to false and 1
corresponding to true.  Make it so.

Change-Id: Ib7418fe7573b5d2cd1e2ef5de601c0262c8d9de1
Reviewed-on: https://code.wireshark.org/review/25605
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-02-04 15:18:23 -08:00
parent a44eece9aa
commit 444cac45b2
1 changed files with 3 additions and 3 deletions

View File

@ -966,7 +966,7 @@ static int vwr_get_fpga_version(wtap *wth, int *err, gchar **err_info)
int f_len, v_type;
guint16 data_length = 0;
guint16 fpga_version;
int valid_but_empty_file = -1;
gboolean valid_but_empty_file = FALSE;
filePos = file_tell(wth->fh);
if (filePos == -1) {
@ -1003,7 +1003,7 @@ static int vwr_get_fpga_version(wtap *wth, int *err, gchar **err_info)
return -1;
}
else if (v_type == VT_CPMSG)
valid_but_empty_file = 1;
valid_but_empty_file = TRUE;
}
else {
rec_size = f_len;
@ -1102,7 +1102,7 @@ static int vwr_get_fpga_version(wtap *wth, int *err, gchar **err_info)
}
/* Is this a valid but empty file? If so, claim it's the S3_W_FPGA FPGA. */
if (valid_but_empty_file > 0) {
if (valid_but_empty_file) {
g_free(rec);
return(S3_W_FPGA);
}