-void buff_append(buff_t *b, char *toadd) {
- int addlen=strlen(toadd);
- int needed_space=b->used+addlen+1;
+void buff_append(buff_t b, const char *toadd) {
+ int addlen;
+ int needed_space;
+
+ if (!b)
+ THROW0(arg_error,0,"Asked to append stuff to NULL buffer");
+
+ addlen = strlen(toadd);
+ needed_space=b->used+addlen+1;