[syslog-ng] [PATCH 2/2] pdbtool: fix a double increment within a loop

balint.kovacs at balabit.com balint.kovacs at balabit.com
Mon Dec 10 09:58:12 CET 2012


From: Balint Kovacs <blint at blint.hu>

When displaying debug-csv information, the loop variable was not
only incremented in the for statement, but also within the loop, which
caused an index mismatch when iterating over the dbg_info array

Signed-off-by: Balint Kovacs <blint at blint.hu>
---
 modules/dbparser/pdbtool/pdbtool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/dbparser/pdbtool/pdbtool.c b/modules/dbparser/pdbtool/pdbtool.c
index 25014fe..c560874 100644
--- a/modules/dbparser/pdbtool/pdbtool.c
+++ b/modules/dbparser/pdbtool/pdbtool.c
@@ -577,7 +577,7 @@ pdbtool_match(int argc, char *argv[])
                     name = nv_registry_get_handle_name(logmsg_registry, dbg_info->pnode->handle, &name_len);
 
                   printf("PDBTOOL_DEBUG=%d:%d:%d:%d:%d:%s:%s\n",
-                        i++, dbg_info->i, dbg_info->node->keylen, dbg_info->match_off, dbg_info->match_len,
+                        i, dbg_info->i, dbg_info->node->keylen, dbg_info->match_off, dbg_info->match_len,
                         dbg_info->pnode ? r_parser_type_name(dbg_info->pnode->type) : "",
                         dbg_info->pnode && name_len ? name : ""
                         );
-- 
1.7.9.5




More information about the syslog-ng mailing list