summaryrefslogtreecommitdiff
path: root/wiretap/merge.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-07-23 12:26:05 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-09-22 10:52:03 +0000
commit56a09d24dcdcaddae1cb67a18bbc2fd588c427ed (patch)
treea9961e4700a00680f7247d714709e6164f9e5d9d /wiretap/merge.c
parentc1d6a4123a2e100a77ae8ec2b3d01544f168febc (diff)
downloadwireshark-56a09d24dcdcaddae1cb67a18bbc2fd588c427ed.tar.gz
Try to fix some buildbot warnings
Most interesting are: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] warning: ISO C forbids zero-size array [-Wpedantic] warning: ISO C90 doesn't support unnamed structs/unions [-Wpedantic] warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual warning: initializer element is not computable at load time [enabled by default] Change-Id: I5573c6bdca856a304877d9bef643f8c0fa93cdaf Reviewed-on: https://code.wireshark.org/review/3174 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'wiretap/merge.c')
-rw-r--r--wiretap/merge.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c
index bea6b53220..bf10f4ccdc 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -50,7 +50,8 @@ merge_open_in_files(int in_file_count, char *const *in_file_names,
merge_in_file_t **in_files, int *err, gchar **err_info,
int *err_fileno)
{
- int i, j;
+ gint i;
+ gint j;
size_t files_size = in_file_count * sizeof(merge_in_file_t);
merge_in_file_t *files;
gint64 size;
@@ -73,7 +74,7 @@ merge_open_in_files(int in_file_count, char *const *in_file_names,
}
size = wtap_file_size(files[i].wth, err);
if (size == -1) {
- for (j = 0; j <= i; j++)
+ for (j = 0; j + 1 > j && j <= i; j++)
wtap_close(files[j].wth);
*err_fileno = i;
return FALSE;