/* Copy given buffer to the output buffer. It is not null terminated.  */
static ssize_t string_write(void *chan_p, const void *buf_p, size_t size)
/* Copy given buffer to the output buffer. It is not null terminated.  */
static ssize_t string_write(void *chan_p, const void *buf_p, size_t size)
{
    struct string_t *string_p;
    string_p = chan_p;
    memcpy(&string_p->buf_p[string_p->pos], buf_p, size);
    string_p->pos += size;
    return (size);
}