Commit 8142139bc4deb35b69e66e9a0002f67fcfa04167

Thomas de Grivel 2024-01-25T12:49:22

fix str_init_alloc

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/libc3/str.c b/libc3/str.c
index fc92bd7..90f1750 100644
--- a/libc3/str.c
+++ b/libc3/str.c
@@ -130,6 +130,7 @@ s_str * str_init_alloc (s_str *str, uw size, const char *p)
   tmp.size = size;
   tmp.ptr.p = tmp.free.p;
   memcpy(tmp.free.p, p, size);
+  *str = tmp;
   return str;
 }