From 0f2396751fccdc9f742230763880f70dbd977f3b Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 21 Dec 2022 11:08:02 +0100 Subject: [PATCH] qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It just so happens that our JSON snippets in qemucapabilitiesdata/*.replies files are separated by an empty line. These empty lines are then overwritten to make a single line JSON. Nevertheless, the line counter @line is not incremented which then leads to a misleading numbers in errors. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- tests/qemumonitortestutils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 46791931b0..4e99c4b54e 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -1302,6 +1302,9 @@ qemuMonitorTestProcessFileEntries(char *inputstr, continue; } + /* We've seen a new line, increment the counter */ + line++; + /* Cut off a single reply. */ *(tmp + 1) = '\0';