summaryrefslogtreecommitdiff
path: root/src/libstddjb/stralloc_catb.c
blob: dac50754deffaa84f3fa511b8e0ea635b80cd2c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <string.h>
#include <skalibs/stralloc.h>

int stralloc_catb (stralloc *sa, char const *s, size_t n)
{
  if (!stralloc_readyplus(sa, n)) return 0 ;
  memmove(sa->s + sa->len, s, n) ;
  sa->len += n ;
  return 1 ;
}