s_append.c 270 B

1234567891011121314151617
  1. #include <u.h>
  2. #include <libc.h>
  3. #include "String.h"
  4. /* append a char array to a String */
  5. String *
  6. s_append(String *to, char *from)
  7. {
  8. if (to == 0)
  9. to = s_new();
  10. if (from == 0)
  11. return to;
  12. for(; *from; from++)
  13. s_putc(to, *from);
  14. s_terminate(to);
  15. return to;
  16. }