mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash if one selects incorrectly Seabear CSV
Fixes #814 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1e45858ee6
commit
2dc1a42b29
2 changed files with 10 additions and 2 deletions
7
file.c
7
file.c
|
@ -932,6 +932,13 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp
|
|||
NL = "\r\n";
|
||||
}
|
||||
|
||||
/*
|
||||
* If file does not contain empty lines, it is not a valid
|
||||
* Seabear CSV file.
|
||||
*/
|
||||
if (!ptr)
|
||||
return -1;
|
||||
|
||||
if (!ptr_old) {
|
||||
while ((ptr = strstr(ptr, "\n\n")) != NULL) {
|
||||
ptr_old = ptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue