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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstddjb/stralloc_copyb.c b/src/libstddjb/stralloc_copyb.c
index 26c3a4c..f32c3e5 100644
--- a/src/libstddjb/stralloc_copyb.c
+++ b/src/libstddjb/stralloc_copyb.c
@@ -5,6 +5,7 @@
int stralloc_copyb (stralloc *sa, char const *s, size_t n)
{
+ if (!n) return 1 ;
if (!stralloc_ready(sa, n)) return 0 ;
memmove(sa->s, s, n) ;
sa->len = n ;