Fixes so "make allnoconfig" works again.
[oweals/busybox.git] / libbb / concat_path_file.c
index e62b99ef689a39a9bea136dfc7589e25097d8953..00233ad9a37ebead3703e9d0b3d4f27afd204da6 100644 (file)
@@ -2,8 +2,8 @@
 /*
  * Utility routines.
  *
- * Copyright (C) many different people.  If you wrote this, please
- * acknowledge your work.
+ * Copyright (C) many different people.
+ * If you wrote this, please acknowledge your work.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,12 +34,11 @@ extern char *concat_path_file(const char *path, const char *filename)
        char *lc;
 
        if (!path)
-           path="";
+               path = "";
        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_xasprintf(&outbuf, "%s%s%s", path, (lc==NULL ? "/" : ""), filename);
 
        return outbuf;
 }