The Repo writer doesn't account the the zero element at schemadata[0],
and starts counting schemas with 0, the attr store reserves schema ID 0
for the empty schema. So the attr store explicitely needs to store that
too, otherwise the repo reader will be confused.
s->keys[i].name = str2id (s->pool, localid2str (s, s->keys[i].name), 0);
}
- write_id (fp, s->szschemata - 1);
- Id *ids = s->schemata + 1;
- for (i = 1; i < s->nschemata; i++)
+ write_id (fp, s->szschemata);
+ Id *ids = s->schemata + 0;
+ for (i = 0; i < s->nschemata; i++)
ids = write_idarray (fp, ids);
assert (ids == s->schemata + s->szschemata);