lc = last_char_is(path, '/');
while (*filename == '/')
filename++;
- outbuf = xmalloc(strlen(path)+strlen(filename)+1+(lc==NULL));
- sprintf(outbuf, "%s%s%s", path, (lc==NULL)? "/" : "", filename);
+ bb_asprintf(&outbuf, "%s%s%s", path, (lc==NULL)? "/" : "", filename);
return outbuf;
}