From 85faefc7b323f8fffbe9229b3184f76f151682a2 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Mon, 10 Jan 2022 18:29:00 +1100
Subject: [PATCH] be shorter with auto_strings function

---
 src/lib66/tree_copy.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lib66/tree_copy.c b/src/lib66/tree_copy.c
index 71052c01..d146527f 100644
--- a/src/lib66/tree_copy.c
+++ b/src/lib66/tree_copy.c
@@ -16,6 +16,7 @@
 
 #include <string.h>
 
+#include <oblibs/string.h>
 #include <oblibs/directory.h>
 #include <oblibs/log.h>
 
@@ -31,9 +32,7 @@ int tree_copy(stralloc *dir, char const *tree,char const *treename)
     char *fdir = 0 ;
     size_t treelen = strlen(tree) ;
     char tmp[treelen + SS_SVDIRS_LEN + 1] ;
-    memcpy(tmp,tree,treelen) ;
-    memcpy(tmp + treelen,SS_SVDIRS,SS_SVDIRS_LEN) ;
-    tmp[treelen + SS_SVDIRS_LEN] = 0 ;
+    auto_strings(tmp, tree, SS_SVDIRS) ;
 
     fdir = dir_create_tmp(dir,"/tmp",treename) ;
     if (!fdir) return 0 ;
-- 
GitLab