summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_register.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-06-01 17:31:12 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-06-01 17:36:34 +0200
commit3fe8431c5044e1337be78d82446d107299106919 (patch)
tree52e11e2a518f52a5bfee4e4b0c017dc5c20a9ac8 /src/tools/irm/irm_register.c
parent1bf6419b10bdde83337b9c501821aed84c53e69b (diff)
downloadouroboros-3fe8431c5044e1337be78d82446d107299106919.tar.gz
ouroboros-3fe8431c5044e1337be78d82446d107299106919.zip
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 <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/tools/irm/irm_register.c')
-rw-r--r--src/tools/irm/irm_register.c6
1 files changed, 2 insertions, 4 deletions
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;
}
}
}