int didstar) // expanded "**" once already
{
char_u *buf;
+ size_t buflen;
char_u *path_end;
char_u *p, *s, *e;
int start_len = gap->ga_len;
}
// make room for file name
- buf = alloc(STRLEN(path) + BASENAMELEN + 5);
+ buflen = STRLEN(path) + BASENAMELEN + 5;
+ buf = alloc(buflen);
if (buf == NULL)
return 0;
{
// For "**" in the pattern first go deeper in the tree to
// find matches.
- STRCPY(buf + len, "/**");
- STRCPY(buf + len + 3, path_end);
+ vim_snprintf((char *)buf + len, buflen - len,
+ "/**%s", path_end);
++stardepth;
(void)unix_expandpath(gap, buf, len + 1, flags, TRUE);
--stardepth;
}
- STRCPY(buf + len, path_end);
+ vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
if (mch_has_exp_wildcard(path_end)) // handle more wildcards
{
// need to expand another component of the path