summaryrefslogtreecommitdiff
path: root/src/libstddjb/stralloc_copyb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/stralloc_copyb.c')
-rw-r--r--src/libstddjb/stralloc_copyb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstddjb/stralloc_copyb.c b/src/libstddjb/stralloc_copyb.c
index be2b397..31fc31e 100644
--- a/src/libstddjb/stralloc_copyb.c
+++ b/src/libstddjb/stralloc_copyb.c
@@ -1,12 +1,13 @@
/* ISC license. */
-#include <skalibs/bytestr.h>
+#include <sys/types.h>
+#include <string.h>
#include <skalibs/stralloc.h>
-int stralloc_copyb (stralloc *sa, char const *s, unsigned int n)
+int stralloc_copyb (stralloc *sa, char const *s, size_t n)
{
if (!stralloc_ready(sa, n)) return 0 ;
- byte_copy(sa->s, n, s) ;
+ memmove(sa->s, s, n) ;
sa->len = n ;
return 1 ;
}