xref: /plan9/sys/src/libString/s_putc.c (revision 80ee5cbfe36716af62da8896207e9763b8e3d760)
1 #include <u.h>
2 #include <libc.h>
3 #include "String.h"
4 
5 void
s_putc(String * s,int c)6 s_putc(String *s, int c)
7 {
8 	if(s->ref > 1)
9 		sysfatal("can't s_putc a shared string");
10 	if (s->ptr >= s->end)
11 		s_grow(s, 2);
12 	*(s->ptr)++ = c;
13 }
14