From: Michal Privoznik Date: Thu, 10 Nov 2022 13:24:43 +0000 (+0100) Subject: vmx: Convert virVMXConfigScanResultsCollector() to use STRCASESKIP() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c428bccc3fc27379c438697a478171f492466220;p=libvirt.git vmx: Convert virVMXConfigScanResultsCollector() to use STRCASESKIP() Now that we have STRCASESKIP() there's no need to open code it. Convert virVMXConfigScanResultsCollector() so that it uses this new macro. Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index bf0dba17d8..d3e452e3ef 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1321,12 +1321,13 @@ virVMXConfigScanResultsCollector(const char* name, void *opaque) { struct virVMXConfigScanResults *results = opaque; + const char *suffix = NULL; - if (STRCASEPREFIX(name, "ethernet")) { + if ((suffix = STRCASESKIP(name, "ethernet"))) { unsigned int idx; char *p; - if (virStrToLong_uip(name + 8, &p, 10, &idx) < 0 || + if (virStrToLong_uip(suffix, &p, 10, &idx) < 0 || *p != '.') { virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to parse the index of the VMX key '%s'"),