Stricter check we get dive profile
We should get either dive trailer or dive profile immediately after header. Thus make sure that is the case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
62d9728ebe
commit
9d65c5bcdd
@ -140,7 +140,13 @@ int parse_dan_format(const char *filename, char **params, int pnr)
|
||||
continue;
|
||||
}
|
||||
|
||||
ptr = strstr(ptr, "ZDP{");
|
||||
/* After ZDH we should get either ZDT (above) or ZDP */
|
||||
if (strncmp(iter, "ZDP{", 4) != 0) {
|
||||
fprintf(stderr, "DEBUG: Input appears to violate DL7 specification\n");
|
||||
end_ptr = iter - (char *)mem.buffer;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ptr && ptr[4] == '}') {
|
||||
end_ptr += ptr - (char *)mem_csv.buffer;
|
||||
return report_error(translate("gettextFromC", "No dive profile found from '%s'"), filename);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user