static int readstanza(STANZA *s)
{
    PAIR *pp = s->pairs;
    char *p, *equals, *key, *value;
    char buff[1024];

    while (BIO_gets(fp, buff, sizeof(buff))) {
        s->curr++;
        if (!TEST_ptr(p = strchr(buff, '\n'))) {
            TEST_info("Line %d too long", s->curr);
            return 0;
        }
        *p = '\0';

        /* Blank line marks end of tests. */
        if (buff[0] == '\0')
            break;

        /* Lines starting with a pound sign are ignored. */
        if (buff[0] == '#')
            continue;

        if (!TEST_ptr(equals = strchr(buff, '='))) {
            TEST_info("Missing = at line %d\n", s->curr);
            return 0;
        }
        *equals++ = '\0';
        if (s->numpairs == 0)
            s->start = s->curr;

        if (!TEST_ptr(key = strip_spaces(buff))
                || !TEST_ptr(value = strip_spaces(equals))
                || !TEST_int_lt(s->numpairs++, MAXPAIRS)
                || !TEST_ptr(pp->key = OPENSSL_strdup(key))
                || !TEST_ptr(pp->value = OPENSSL_strdup(value)))
            return 0;
        pp++;
    }

    /* If we read anything, return ok. */
    return 1;
}