Apply vodz' last_patch52
[oweals/busybox.git] / libbb / concat_path_file.c
index e62b99ef689a39a9bea136dfc7589e25097d8953..0146606a1db50f89defb4c4431c7cda2495bf97e 100644 (file)
@@ -38,8 +38,7 @@ extern char *concat_path_file(const char *path, const char *filename)
        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;
 }