From: Florian Forster Date: Tue, 28 Nov 2017 07:11:07 +0000 (+0100) Subject: virt plugin: Remove `do {} while(0)` loop around macro. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0ff2e3c812858d876c9977daf8f51ce5edb60d7e;p=collectd.git virt plugin: Remove `do {} while(0)` loop around macro. The `continue` in the macro was supposed to continue the `for` loop, but was (unexpectedly) exiting the do…while loop instead. CID: 179238 --- diff --git a/src/virt.c b/src/virt.c index ca6e831e..174db2fa 100644 --- a/src/virt.c +++ b/src/virt.c @@ -444,12 +444,10 @@ static void init_block_info(struct lv_block_info *binfo) { #ifdef HAVE_BLOCK_STATS_FLAGS #define GET_BLOCK_INFO_VALUE(NAME, FIELD) \ - do { \ - if (!strcmp(param[i].field, NAME)) { \ - binfo->FIELD = param[i].value.l; \ - continue; \ - } \ - } while (0) + if (!strcmp(param[i].field, NAME)) { \ + binfo->FIELD = param[i].value.l; \ + continue; \ + } static int get_block_info(struct lv_block_info *binfo, virTypedParameterPtr param, int nparams) {