util: Fix condition check in virDiskNameToIndex

Use the more common '< 0' rather than the non-zero check.
This commit is contained in:
Peter Krempa 2017-11-01 10:30:04 +01:00
parent ae1b5d47e5
commit e5580888f5

View 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;