aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-10-15 08:40:43 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-10-15 08:40:43 +0000
commitf682f1955b821bf56ede7bc3af87cca4c2aedfa9 (patch)
treed3bbe493d5239e09c006d424d5381e85101a074e /editcap.c
parente0c023859e1cb58f54fd2aa2920be1542a974705 (diff)
From Jim Young:
Have editcap use modulo when calculating filenum component of fileset name . https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7863 svn path=/trunk/; revision=45556
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/editcap.c b/editcap.c
index a75f85a2a6..67d46bf899 100644
--- a/editcap.c
+++ b/editcap.c
@@ -65,6 +65,8 @@
#include "svnversion.h"
+#include "ringbuffer.h" /* For RINGBUFFER_MAX_NUM_FILES */
+
/*
* Some globals so we can pass things to various routines
*/
@@ -179,7 +181,7 @@ fileset_get_filename_by_pattern(guint idx, const struct wtap_nstime *time_val
gchar *abs_str;
timestr = abs_time_to_str_with_sec_resolution(time_val);
- g_snprintf(filenum, sizeof(filenum), "%05u", idx);
+ g_snprintf(filenum, sizeof(filenum), "%05u", idx % RINGBUFFER_MAX_NUM_FILES);
abs_str = g_strconcat(fprefix, "_", filenum, "_", timestr, fsuffix, NULL);
g_free(timestr);