mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 7 additions and 1 deletions
|
@ -140,7 +140,13 @@ int parse_dan_format(const char *filename, char **params, int pnr)
|
||||||
continue;
|
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] == '}') {
|
if (ptr && ptr[4] == '}') {
|
||||||
end_ptr += ptr - (char *)mem_csv.buffer;
|
end_ptr += ptr - (char *)mem_csv.buffer;
|
||||||
return report_error(translate("gettextFromC", "No dive profile found from '%s'"), filename);
|
return report_error(translate("gettextFromC", "No dive profile found from '%s'"), filename);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue