diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-09-24 16:12:29 -0700 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2012-10-03 11:47:23 -0700 |
commit | 1b4da8527d2719cc9ab1f5ed1390ffac44772230 (patch) | |
tree | cce587a0f5de28ba4beb99e0e195ad10c0792fe9 | |
parent | 0a27c707eafe57a85266452a395f89c8237efdbf (diff) | |
download | xf86-input-wacom-1b4da8527d2719cc9ab1f5ed1390ffac44772230.tar.gz |
Properly handle nulls in wcmCheckSource
Commit cff344b1 modified the null-handling of wcmCheckSource, such
that the wrong result will be returned if either/both fsource and
psource are null. This patch restores the original behavior.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmValidateDevice.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index a296984..1d09102 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -46,16 +46,15 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t min_maj) if (pInfo != pDevices) { WacomCommonPtr pCommon = ((WacomDevicePtr)pDevices->private)->common; - char* fsource = xf86CheckStrOption(pInfo->options, "_source", NULL); - char* psource = xf86CheckStrOption(pDevices->options, "_source", NULL); + char* fsource = xf86CheckStrOption(pInfo->options, "_source", ""); + char* psource = xf86CheckStrOption(pDevices->options, "_source", ""); if (pCommon->min_maj && pCommon->min_maj == min_maj) { /* only add the new tool if the matching major/minor * was from the same source */ - if ((!fsource && !psource) || - (fsource && psource && strcmp(fsource, psource))) + if (strcmp(fsource, psource)) { match = 1; break; |