Logo Search packages:      
Sourcecode: bglibs version File versions

int str_cat2s ( str s,
const char *  a,
const char *  b 
)

Append 2 C strings

Definition at line 22 of file cat2s.c.

References len, s, and str_realloc.

{
  char* ptr;
  unsigned alen = strlen(a);
  unsigned blen = strlen(b);
  if (!str_realloc(s, s->len+alen+blen)) return 0;
  ptr = s->s + s->len;
  s->len += alen+blen;
  memcpy(ptr, a, alen); ptr += alen;
  memcpy(ptr, b, blen); ptr += blen;
  *ptr = 0;
  return 1;
}


Generated by  Doxygen 1.6.0   Back to index