From 33759f4556096a2c17f0aaae246788752f4dc39c Mon Sep 17 00:00:00 2001 From: Holger Macht Date: Wed, 15 Aug 2007 13:48:35 +0200 Subject: function always returned 0, whether capability was found or not --- liblazy/liblazy_hal.c | 11 ++++++----- 1 file 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; } -- cgit v1.2.3