Changeset 25cec35d in subsurface


Ignore:
Timestamp:
May 7, 2017, 7:48:12 AM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
22f07f5
Parents:
92d24a2
git-author:
Salvador Cuñat <salvador.cunat@…> (05/07/17 01:15:59)
git-committer:
Dirk Hohndel <dirk@…> (05/07/17 07:48:12)
Message:

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@…>

Location:
core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/file.c

    r6399eaf r25cec35d  
    535535        /* DataTrak/Wlog */
    536536        if (fmt && !strcasecmp(fmt + 1, "LOG")) {
    537                 datatrak_import(filename, &dive_table);
    538                 return 0;
     537                ret = datatrak_import(&mem, &dive_table);
     538                free(mem.buffer);
     539                return ret;
    539540        }
    540541
  • core/file.h

    r6399eaf r25cec35d  
    1010extern int try_to_open_cochran(const char *filename, struct memblock *mem);
    1111extern int try_to_open_liquivision(const char *filename, struct memblock *mem);
    12 extern void datatrak_import(const char *file, struct dive_table *table);
     12extern int datatrak_import(struct memblock *mem, struct dive_table *table);
    1313extern void ostctools_import(const char *file, struct dive_table *table);
    1414
Note: See TracChangeset for help on using the changeset viewer.