mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Ignore empty dives
This is first step towards parsing "empty" dives properly. I.e. now the updated test dive parses properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
e2197a56a4
commit
62d9728ebe
1 changed files with 15 additions and 0 deletions
|
@ -125,6 +125,21 @@ int parse_dan_format(const char *filename, char **params, int pnr)
|
||||||
params[pnr + 5] = strdup(tmpbuf);
|
params[pnr + 5] = strdup(tmpbuf);
|
||||||
params[pnr + 6] = NULL;
|
params[pnr + 6] = NULL;
|
||||||
|
|
||||||
|
/* Search for the next line */
|
||||||
|
if (iter)
|
||||||
|
iter = strstr(iter, NL);
|
||||||
|
if (iter) {
|
||||||
|
iter += strlen(NL);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "DEBUG: No new line found");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
/* We got a trailer, no samples on this dive */
|
||||||
|
if (strncmp(iter, "ZDT", 3) == 0) {
|
||||||
|
end_ptr = iter - (char *)mem.buffer;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ptr = strstr(ptr, "ZDP{");
|
ptr = strstr(ptr, "ZDP{");
|
||||||
if (ptr && ptr[4] == '}') {
|
if (ptr && ptr[4] == '}') {
|
||||||
end_ptr += ptr - (char *)mem_csv.buffer;
|
end_ptr += ptr - (char *)mem_csv.buffer;
|
||||||
|
|
Loading…
Add table
Reference in a new issue