From 3fe8431c5044e1337be78d82446d107299106919 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 1 Jun 2018 17:31:12 +0200 Subject: tools: Fix bad wildcard match in irm tool The pattern was matched to the string instead of the string to the pattern, which means it only worked if it was a perfect match. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/tools/irm/irm_register.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/tools/irm') diff --git a/src/tools/irm/irm_register.c b/src/tools/irm/irm_register.c index 23c65f7d..ca15abcf 100644 --- a/src/tools/irm/irm_register.c +++ b/src/tools/irm/irm_register.c @@ -113,21 +113,19 @@ int do_register(int argc, for (i = 0; i < len; ++i) { size_t j; for (j = 0; j < layers_len; j++) { - if (wildcard_match(ipcps[i].layer, layers[j]) == 0) { + if (wildcard_match(layers[j], ipcps[i].layer) == 0) { if (irm_reg(ipcps[i].pid, name)) { free(ipcps); return -1; } - break; } } for (j = 0; j < ipcp_len; j++) { - if (wildcard_match(ipcps[i].name, ipcp[j]) == 0) { + if (wildcard_match(ipcp[j], ipcps[i].name) == 0) { if (irm_reg(ipcps[i].pid, name)) { free(ipcps); return -1; } - break; } } } -- cgit v1.2.3