aboutsummaryrefslogtreecommitdiffstats
path: root/src/tree.c
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-02-26 13:36:16 +0000
committerJoursoir <chat@joursoir.net>2021-02-26 13:36:16 +0000
commita8fe7bce0ea33f71485cf8c2e4c8330831c849ce (patch)
tree6d4edaf2142c43b188b91203998d154e45804565 /src/tree.c
parente6f8a3570b63724091c4cec78db609ad65963d65 (diff)
downloadlock-password-a8fe7bce0ea33f71485cf8c2e4c8330831c849ce.tar.gz
lock-password-a8fe7bce0ea33f71485cf8c2e4c8330831c849ce.tar.bz2
lock-password-a8fe7bce0ea33f71485cf8c2e4c8330831c849ce.zip
rename handerror to xstd; create and use some routines
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/tree.c b/src/tree.c
index 658b6cf..387ef8b 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -6,6 +6,7 @@
#include <sys/stat.h>
#include "tree.h"
+#include "xstd.h"
#define ANSIC_RST "\x1B[0m"
#define ANSIC_BBLU "\x1B[34;1m"
@@ -61,20 +62,6 @@ static int count_dir_entries(const char *path)
return counter;
}
-static char *xstrcat(const char *first, const char *second,
- const char *delimiter)
-{
- size_t size = sizeof(char) * (strlen(first) + strlen(second) + 1);
- if(delimiter)
- size += sizeof(char) * strlen(delimiter);
- char *res = malloc(size);
- strcpy(res, first);
- if(delimiter)
- strcat(res, delimiter);
- strcat(res, second);
- return res;
-}
-
int tree(const char *path, const char *prefix)
{
DIR *main_dir;