From f852556e8a75eb568e551b23821a55d28c38f2cd Mon Sep 17 00:00:00 2001
From: dimitri staessens <dimitri.staessens@intec.ugent.be>
Date: Tue, 5 Jul 2016 15:59:04 +0200
Subject: lib:irm: fix ap check when full path is given.

The check_ap_path function didn't return correctly when the first
check was successful.
---
 src/lib/irm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/lib')

diff --git a/src/lib/irm.c b/src/lib/irm.c
index 8f475e38..a81fdad3 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -268,9 +268,11 @@ static int check_ap_path(char ** ap_name)
         if (*ap_name == NULL || path == NULL)
                 return -EINVAL;
 
-        if (!strlen(path) || strchr(*ap_name, '/') == NULL)
+        if (!strlen(path) || strchr(*ap_name, '/') != NULL) {
                 if ((ret = check_ap(*ap_name)) < 0)
                         return ret;
+                return 0;
+        }
 
         tmp = malloc(strlen(path) + strlen(*ap_name) + 2);
         if (tmp == NULL)
-- 
cgit v1.2.3