From: Michal Privoznik Date: Wed, 21 Dec 2022 10:08:02 +0000 (+0100) Subject: qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries() X-Git-Tag: v9.0.0-rc1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f2396751fccdc9f742230763880f70dbd977f3b;p=thirdparty%2Flibvirt.git qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries() 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 --- 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';