const char *data, const char *how) {
warn("corrupted file: %s, offset %lu: %s: in %s",
ipf->path, (unsigned long)offset, how, sanitise(data,-1));
- ipf->readcount_err++;
- if (ipf->readcount_err > max_bad_data_initial +
- (ipf->readcount_ok+ipf->readcount_blank) / max_bad_data_ratio)
+ ipf->counts.events[read_err]++;
+ if (ipf->counts.events[read_err] > max_bad_data_initial +
+ (ipf->counts.events[read_ok] + ipf->counts.events[read_blank])
+ / max_bad_data_ratio)
crash("too much garbage in input file! (%d errs, %d ok, %d blank)",
- ipf->readcount_err, ipf->readcount_ok, ipf->readcount_blank);
+ ipf->counts.events[read_err], ipf->counts.events[read_ok],
+ ipf->counts.events[read_blank]);
return OOP_CONTINUE;
}
if (data[0]==' ') {
if (strspn(data," ") != recsz) X_BAD_DATA("line partially blanked");
- ipf->readcount_blank++;
+ ipf->counts.events[read_blank]++;
return OOP_CONTINUE;
}
tokentextbuf[tokenlen]= 0;
if (!IsToken(tokentextbuf)) X_BAD_DATA("token wrong syntax");
- ipf->readcount_ok++;
+ ipf->counts.events[read_ok]++;
art= xmalloc(sizeof(*art) - 1 + midlen + 1);
memset(art,0,sizeof(*art));