char *s, *r;
char sep;
int wcount = 1;
- size_t len;
- char needle[BUFFER_LEN];
+ char needle[BUFFER_LEN], haystack[BUFFER_LEN];
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
- strncpy(needle, remove_markup(args[1], &len), BUFFER_LEN);
+ strncpy(haystack, remove_markup(args[0], NULL), BUFFER_LEN);
+ strncpy(needle, remove_markup(args[1], NULL), BUFFER_LEN);
/* Walk the wordstring, until we find the word we want. */
- s = trim_space_sep(remove_markup(args[0], &len), sep);
+ s = trim_space_sep(haystack, sep);
do {
r = split_token(&s, sep);
if (quick_wild(needle, r)) {