when -G -C is used the filename counter continued. Changed the behaviour
so that when -G is rolled over to the next file the Cflag-counter is
reset to 0 so that the filenames will restart counting.
dump_info->CurrentFileName = (char *)malloc(PATH_MAX + 1);
if (dump_info->CurrentFileName == NULL)
error("dump_packet_and_trunc: malloc");
+ /*
+ * Gflag was set otherwise we wouldn't be here. Reset the count
+ * so multiple files would end with 1,2,3 in the filename.
+ * The counting is handled with the -C flow after this.
+ */
+ Cflag_count = 0;
+
/*
* This is always the first file in the Cflag
* rotation: e.g. 0