From 86e1d59a6ad1dcf3965de917520e541844c6bd56 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 7 Feb 2022 22:12:25 +0100 Subject: [PATCH] Limit the number of records for the Predator In the older Predator-like data format, the 4th opening/closing record is the last one. To avoid accidental use of the higher ones, leave them undefined. --- src/shearwater_predator_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c index a79677f..360b978 100644 --- a/src/shearwater_predator_parser.c +++ b/src/shearwater_predator_parser.c @@ -373,7 +373,7 @@ shearwater_predator_parser_cache (shearwater_predator_parser_t *parser) // byte opening and closing block. To minimize the differences // with the PNF format, all record offsets are assigned the same // value here. - for (unsigned int i = 0; i < NRECORDS; ++i) { + for (unsigned int i = 0; i <= 4; ++i) { parser->opening[i] = 0; parser->closing[i] = size - footersize; }