[CLEANUP] acl, patterns: make use of my_strndup() instead of malloc+memcpy
This is simpler and more readable.
diff --git a/src/pattern.c b/src/pattern.c
index 5afd068..63bae2b 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -397,9 +397,7 @@
if (end != endw) {
expr->arg_len = end - endw - 2;
- expr->arg = malloc(expr->arg_len + 1);
- expr->arg = memcpy(expr->arg, endw + 1, expr->arg_len);
- expr->arg[expr->arg_len] = '\0';
+ expr->arg = my_strndup(endw + 1, expr->arg_len);
}
for (*idx += 1; *(str[*idx]); (*idx)++) {