/* Licensed under BSD-MIT - see LICENSE file for details */
#include <ccan/tal/path/path.h>
#include <ccan/str/str.h>
-#include <ccan/take/take.h>
#include <ccan/tal/str/str.h>
#include <sys/types.h>
#include <sys/stat.h>
ret = tal_dup_arr(ctx, char, base, len, 1 + strlen(a) + 1);
if (!ret)
goto out;
- if (ret[len-1] != PATH_SEP)
+ if (len != 0 && ret[len-1] != PATH_SEP)
ret[len++] = PATH_SEP;
strcpy(ret + len, a);