- add a few basic tests for pidof(8)
[oweals/busybox.git] / libbb / concat_path_file.c
index f0ce3d91c6460af22d51879deac92a9da22519f8..029c23272a6479a26f129a364f3ab3d68f3fc098 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Utility routines.
  *
- * Copyright (C) many different people.  
+ * 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
 
 extern char *concat_path_file(const char *path, const char *filename)
 {
-       char *outbuf;
        char *lc;
 
        if (!path)
-           path="";
+               path = "";
        lc = last_char_is(path, '/');
        while (*filename == '/')
                filename++;
-       bb_xasprintf(&outbuf, "%s%s%s", path, (lc==NULL)? "/" : "", filename);
-
-       return outbuf;
+       return bb_xasprintf("%s%s%s", path, (lc==NULL ? "/" : ""), filename);
 }