aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-10 17:48:46 -0800
committerGuy Harris <guy@alum.mit.edu>2016-02-11 01:49:49 +0000
commit01a3873505e6f5c6b0b92914345478ff250d5248 (patch)
treed4ead072c844a32a4c6ed6f721f47c484c3b5748
parent5cffcf20b147ac88d58774ccce0b76db4704b329 (diff)
Make file indices consistently unsigned in the merge code.
Change-Id: Ie531e5c24c32ca86abbe0c2b5d3526014e5fb831 Reviewed-on: https://code.wireshark.org/review/13897 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--file.c2
-rw-r--r--wiretap/merge.c12
-rw-r--r--wiretap/merge.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/file.c b/file.c
index de4b4c045b..4f493dc61c 100644
--- a/file.c
+++ b/file.c
@@ -1332,7 +1332,7 @@ cf_merge_files(char **out_filenamep, int in_file_count,
int out_fd;
int err = 0;
gchar *err_info = NULL;
- int err_fileno;
+ guint err_fileno;
merge_result status;
merge_progress_callback_t cb;
diff --git a/wiretap/merge.c b/wiretap/merge.c
index 06dc5db617..b4e1438b0e 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -119,12 +119,12 @@ add_idb_index_map(merge_in_file_t *in_file, const guint orig_index, const guint
* @return TRUE if all files could be opened, FALSE otherwise
*/
static gboolean
-merge_open_in_files(int in_file_count, const char *const *in_file_names,
+merge_open_in_files(guint in_file_count, const char *const *in_file_names,
merge_in_file_t **in_files, int *err, gchar **err_info,
- int *err_fileno)
+ guint *err_fileno)
{
- gint i;
- gint j;
+ guint i;
+ guint j;
size_t files_size = in_file_count * sizeof(merge_in_file_t);
merge_in_file_t *files;
gint64 size;
@@ -148,7 +148,7 @@ merge_open_in_files(int in_file_count, const char *const *in_file_names,
}
size = wtap_file_size(files[i].wth, err);
if (size == -1) {
- for (j = 0; j != G_MAXINT && j <= i; j++)
+ for (j = 0; j != G_MAXUINT && j <= i; j++)
cleanup_in_file(&files[j]);
*err_fileno = i;
return FALSE;
@@ -842,7 +842,7 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type,
const char *const *in_filenames, const guint in_file_count,
const gboolean do_append, const idb_merge_mode mode,
guint snaplen, const gchar *app_name, merge_progress_callback_t* cb,
- int *err, gchar **err_info, int *err_fileno)
+ int *err, gchar **err_info, guint *err_fileno)
{
merge_in_file_t *in_files = NULL, *in_file = NULL;
int frame_type = WTAP_ENCAP_PER_PACKET;
diff --git a/wiretap/merge.h b/wiretap/merge.h
index 9c36dc4fc7..4fa0882868 100644
--- a/wiretap/merge.h
+++ b/wiretap/merge.h
@@ -144,7 +144,7 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type,
const char *const *in_filenames, const guint in_file_count,
const gboolean do_append, const idb_merge_mode mode,
guint snaplen, const gchar *app_name, merge_progress_callback_t* cb,
- int *err, gchar **err_info, int *err_fileno);
+ int *err, gchar **err_info, guint *err_fileno);
#ifdef __cplusplus
}