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

    while (fgets(buff, sizeof(buff), fp) != NULL) {
        (*linesread)++;
        if ((p = strchr(buff, '\n')) == NULL) {
            fprintf(stderr, "Line %d too long.\n", s->start);
            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 ((equals = strchr(buff, '=')) == NULL) {
            fprintf(stderr, "Line %d missing equals.\n", s->start);
            return 0;
        }
        *equals++ = '\0';

        key = strip_spaces(buff);
        value = strip_spaces(equals);
        if (key == NULL || value == NULL) {
            fprintf(stderr, "Line %d missing field.\n", s->start);
            return 0;
        }
        s->numpairs++;
        if (s->numpairs >= MAXPAIRS) {
            fprintf(stderr, "Line %d too many lines\n", s->start);
            return 0;
        }
        pp->key = OPENSSL_strdup(key);
        pp->value = OPENSSL_strdup(value);
        pp++;
    }

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