[RFC PATCH] Datatrak parsing

Salvador Cuñat salvador.cunat at gmail.com
Wed Sep 9 14:30:16 PDT 2015


Godd night Dirk, Miika

2015-09-09 18:13 GMT+02:00 Dirk Hohndel <dirk at hohndel.org>:

> On Wed, Sep 09, 2015 at 06:13:49PM +0300, Miika Turkia wrote:
> > I have some trouble understanding this code, but as there is a clear
> > bug involved (null dereference), I ask others to verify if I am onto
> > something. And if datatrak import still works with this patch.
>
>
Works fine for me Miika.


> So this interesting pattern
>
> +               dt_dive = NULL;
> +               return(*dt_dive);
>
> (which Lubomir improved by removing the unnecessary parenthesis) was in
> the original commit 44b55bd1a220 by Salvador Cuñat <
> salvador.cunat at gmail.com>
>
> Me thinks that this may never have worked all that well.
>
> Salvador, any comments on Miika's patch?
>
>
I was pretty sure I had patched this scrap long ago, in a similar fashion
as Miika has done; in fact I realized it while reviewing Lubomir's clean up.
The problem was, curiously, that none of the files I had, triggered the
obvius segfault.  I have had to tweak them to force the crash on failing to
found the dive begin marker.
Perhaps, the reported error would need an improvement as it is of poor
meaning, both in GUI and in stderr, I will look at it this weekend.

Miika, if you want to run tests, there is  Example.log  in dives directory
(the example file shipped with the original software).   The file is
correct so it will not fail;  you will need to manually edit it to force
failures, e.g. changing some A0 00 bytes with A0 01.

Regards.

Salva.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150909/e7161960/attachment.html>


More information about the subsurface mailing list