mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 01:16:21 +00:00
feat(flatfile): warn on missing or mismatched log format-version
This commit is contained in:
@@ -205,6 +205,15 @@ _ff_state_build(ff_contact_state_t* state)
|
||||
|
||||
state->bom_len = ff_skip_bom(fp);
|
||||
|
||||
int file_version = ff_read_format_version(fp);
|
||||
if (file_version == 0) {
|
||||
log_warning("flatfile: %s has no format-version marker, expected %d",
|
||||
state->filepath, FLATFILE_FORMAT_VERSION);
|
||||
} else if (file_version != FLATFILE_FORMAT_VERSION) {
|
||||
log_warning("flatfile: %s format-version %d does not match expected %d",
|
||||
state->filepath, file_version, FLATFILE_FORMAT_VERSION);
|
||||
}
|
||||
|
||||
state->n_entries = 0;
|
||||
state->total_lines = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user