s_putc.c 205 B

12345678910111213
  1. #include <u.h>
  2. #include <libc.h>
  3. #include "String.h"
  4. void
  5. s_putc(String *s, int c)
  6. {
  7. if(s->ref > 1)
  8. sysfatal("can't s_putc a shared string");
  9. if (s->ptr >= s->end)
  10. s_grow(s, 2);
  11. *(s->ptr)++ = c;
  12. }