summaryrefslogtreecommitdiffstats
path: root/core/file.c
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2017-05-07 10:15:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-07 07:48:12 -0700
commit25cec35d24a89ecf114961acc52415566f332dea (patch)
tree39ac30ea25a7698ca002331b7bd116b13bcfe182 /core/file.c
parent92d24a2912d1e9302b86d74a13a9bc124e7b380c (diff)
downloadsubsurface-25cec35d24a89ecf114961acc52415566f332dea.tar.gz
Datatrak import rework: changes of file.c and file.h
Datatrak import is called from parse_file() in file.c. This function reads the full file to be imported into a memblock structure. It's easier and more secure, to parse this buffer instead of the file itself. These are the necessary changes in function datatrak_import() declaration and call. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Diffstat (limited to 'core/file.c')
-rw-r--r--core/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/file.c b/core/file.c
index ba2956d60..59d00badb 100644
--- a/core/file.c
+++ b/core/file.c
@@ -534,8 +534,9 @@ int parse_file(const char *filename)
/* DataTrak/Wlog */
if (fmt && !strcasecmp(fmt + 1, "LOG")) {
- datatrak_import(filename, &dive_table);
- return 0;
+ ret = datatrak_import(&mem, &dive_table);
+ free(mem.buffer);
+ return ret;
}
/* OSTCtools */