static int append_buf(char **buf, int *size, const char *s)
{
    const int expand = 256;
    int len = strlen(s) + 1;
    char *p = *buf;
    if (p == NULL) {
        *size = ((len + expand - 1) / expand) * expand;
        p = *buf = app_malloc(*size, "engine buffer");
    } else {
        const int blen = strlen(p);
        if (blen > 0)
            len += 2 + blen;
        if (len > *size) {
            *size = ((len + expand - 1) / expand) * expand;
            p = OPENSSL_realloc(p, *size);
            if (p == NULL) {
                OPENSSL_free(*buf);
                *buf = NULL;
                return 0;
            }
            *buf = p;
        }
        if (blen > 0) {
            p += blen;
            *p++ = ',';
            *p++ = ' ';
        }
    }
    strcpy(p, s);
    return 1;
}
['static int append_buf(char **buf, int *size, const char *s)\n{\n    const int expand = 256;\n    int len = strlen(s) + 1;\n    char *p = *buf;\n    if (p == NULL) {\n        *size = ((len + expand - 1) / expand) * expand;\n        p = *buf = app_malloc(*size, "engine buffer");\n    } else {\n        const int blen = strlen(p);\n        if (blen > 0)\n            len += 2 + blen;\n        if (len > *size) {\n            *size = ((len + expand - 1) / expand) * expand;\n            p = OPENSSL_realloc(p, *size);\n            if (p == NULL) {\n                OPENSSL_free(*buf);\n                *buf = NULL;\n                return 0;\n            }\n            *buf = p;\n        }\n        if (blen > 0) {\n            p += blen;\n            *p++ = \',\';\n            *p++ = \' \';\n        }\n    }\n    strcpy(p, s);\n    return 1;\n}']