Displaying 1 result from an estimated 1 matches for "cat_len".
Did you mean:
cap_len
2014 Jan 01
0
Soft chroot jail for sftp-server
...eturn xstrdup(child);
> size_t child_len = strlen(child);
> if (child_len < 1)
> return xstrdup(parent);
>
> if (*child == '/') {
> child++;
> child_len--;
> }
>
> char* cat;
> if (*(parent + parent_len - 1) == '/') {
> size_t cat_len = sizeof(char) * (parent_len + child_len + 1);
> cat = xmalloc(sizeof(char) * cat_len);
> *cat = '\0';
> strlcat(cat,parent,cat_len);
> strlcat(cat,child,cat_len);
> return cat;
> } else {
> size_t cat_len = sizeof(char) * (parent_len + child_len + 2);
>...