]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Fix condition check in virDiskNameToIndex
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Nov 2017 09:30:04 +0000 (10:30 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 7 Nov 2017 13:29:37 +0000 (14:29 +0100)
Use the more common '< 0' rather than the non-zero check.

src/util/virutil.c

index 170e921920efbf9f8ff2d5b2f15c6c938c704a6e..8bdcb02fd5d049e2ee98606e6d07a84d6f8b3115 100644 (file)
@@ -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;