Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
539 B

  1. #include "byte.h"
  2. #include "stralloc.h"
  3. /* stralloc_catb adds the string buf[0], buf[1], ... buf[len-1] to the
  4. * end of the string stored in sa, allocating space if necessary, and
  5. * returns 1. If sa is unallocated, stralloc_catb is the same as
  6. * stralloc_copyb. If it runs out of memory, stralloc_catb leaves sa
  7. * alone and returns 0. */
  8. int stralloc_catb(stralloc *sa,const char *buf,unsigned long int len) {
  9. if (stralloc_readyplus(sa,len)) {
  10. byte_copy(sa->s+sa->len,len,buf);
  11. sa->len+=len;
  12. return 1;
  13. }
  14. return 0;
  15. }