Skip to content

Commit d557881

Browse files
committed
Fix wcmForeachDevice check in wcmMatchDevice
wcmForeachDevice returns 0 for no matches, a negative errno or the greater-than-zero number of matches. In wcmMatchDevice we return either 0 or 1 as matchDevice() stops the foreach once the first match is encountered. Fixes: d5ca999 ("Add a helper function to iterate over local devices to the driver layer") Closes #342
1 parent f424151 commit d557881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wcmConfig.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static Bool wcmMatchDevice(WacomDevicePtr priv, WacomCommonPtr *common_return)
413413
return 0;
414414

415415
/* If a match is found, priv->common has been replaced */
416-
if (wcmForeachDevice(priv, matchDevice, priv) == 0)
416+
if (wcmForeachDevice(priv, matchDevice, priv) > 0)
417417
*common_return = priv->common;
418418
return 0;
419419
}

0 commit comments

Comments
 (0)