diff options
author | Holger Macht <holger@homac.de> | 2007-08-15 13:48:35 +0200 |
---|---|---|
committer | Holger Macht <holger@homac.de> | 2007-08-15 13:48:35 +0200 |
commit | 33759f4556096a2c17f0aaae246788752f4dc39c (patch) | |
tree | 51e59490d6ff9baf3c581df3c98e7fb3ee059dec | |
parent | 3f4415a5b9adf8ebbd7c0cb79bdff09f5807501a (diff) |
function always returned 0, whether capability was found or not
-rw-r--r-- | liblazy/liblazy_hal.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/liblazy/liblazy_hal.c b/liblazy/liblazy_hal.c index 4b7dd43..a80d7e4 100644 --- a/liblazy/liblazy_hal.c +++ b/liblazy/liblazy_hal.c @@ -235,16 +235,17 @@ int liblazy_hal_query_capability(char *udi, char *capability) return LIBLAZY_ERROR_INVALID_ARGUMENT; error = liblazy_hal_get_property_strlist(udi, "info.capabilities", &caps); - if (caps != NULL && !error) { + if (error) + return error; + + if (caps != NULL) { for (i = 0; caps[i] != NULL; i++) { - if (strcmp(caps[i], capability) == 0) { + if (strcmp(caps[i], capability) == 0) error = 1; - break; - } } liblazy_free_strlist(caps); - error = 0; } + return error; } |