pgdbf icon indicating copy to clipboard operation
pgdbf copied to clipboard

Corrupted memos

Open pupitetris opened this issue 4 years ago • 0 comments

More robust handling of MEMO records, and ability to detect corrupt MEMO data and report it on the output and stderr.

pgdbf was crashing on me due to a mismatched dbf/fpt combo. Added code to prevent calling safeprintbuf with a memo length that in combination with the memo start offset, exceeds the memo file length.

Usage:

-w excesslength

Warn of corrupted MEMO fields, by reporting errors on the output and through standard error. excesslenght specifies a MEMO length beyond which a MEMO record will be considered corrupt. A value of 0 (zero) will disable this heuristic, but the other warnings will still be issued (invalid start offset, invalid type, zero length and length beyond end of file). Conversion will not stop when warnings are issued.

Also:

src/pgdbf.h:exitwitherror: Flush the standard output in case data is still buffered. Some processed output was being left out if the program crashed or exit.

pupitetris avatar Jun 18 '20 20:06 pupitetris