From a54f6e0a56028816fbccb2a3b160e506914dcd10 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 9 Dec 2017 11:47:31 +0500 Subject: [PATCH] Driver: Fix traffic flushing. --- src/driver/fortstat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/driver/fortstat.c b/src/driver/fortstat.c index 9faaa6ab..2b010b10 100644 --- a/src/driver/fortstat.c +++ b/src/driver/fortstat.c @@ -113,7 +113,7 @@ fort_stat_proc_exclude (PFORT_STAT stat, PFORT_STAT_PROC ex_proc, static void fort_stat_proc_free (PFORT_STAT stat, PFORT_STAT_PROC proc, UINT16 proc_index, - PFORT_STAT_PROC prev_proc) + PFORT_STAT_PROC prev_proc /* = NULL */) { /* Exclude from the active chain */ if (prev_proc == NULL) { @@ -512,8 +512,7 @@ fort_stat_dpc_traf_flush (PFORT_STAT stat, PCHAR out) for (UINT16 i = 0; proc_index != FORT_PROC_BAD_INDEX; ++i) { PFORT_STAT_PROC proc = &stat->procs[proc_index]; - - proc_index = proc->next_index; + const UINT16 next_index = proc->next_index; /* Write bytes */ *out_traf++ = proc->traf; @@ -529,6 +528,8 @@ fort_stat_dpc_traf_flush (PFORT_STAT stat, PCHAR out) prev_proc = proc; } + + proc_index = next_index; } stat->is_dirty = FALSE;