From: Peter Krempa Date: Wed, 1 Nov 2017 09:30:04 +0000 (+0100) Subject: util: Fix condition check in virDiskNameToIndex X-Git-Tag: v3.10.0-rc1~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5580888f5d5f1f5937d22ac73a9f9fdebb5ed51;p=thirdparty%2Flibvirt.git util: Fix condition check in virDiskNameToIndex Use the more common '< 0' rather than the non-zero check. --- diff --git a/src/util/virutil.c b/src/util/virutil.c index 170e921920..8bdcb02fd5 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -562,7 +562,7 @@ int virDiskNameToIndex(const char *name) { int idx; - if (virDiskNameParse(name, &idx, NULL)) + if (virDiskNameParse(name, &idx, NULL) < 0) idx = -1; return idx;