diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-02-01 13:45:07 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-01 07:06:12 -0800 |
commit | 2dc1a42b297eb49850767e71a644e5efc349b0c9 (patch) | |
tree | ab7cb7224edba1f967da8d1f76976e5d8837021f /file.c | |
parent | 1e45858ee6e40da932be301e39d3fced6b393490 (diff) | |
download | subsurface-2dc1a42b297eb49850767e71a644e5efc349b0c9.tar.gz |
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>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |