<div dir="ltr">Godd night Dirk, Miika<br><div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-09 18:13 GMT+02:00 Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Sep 09, 2015 at 06:13:49PM +0300, Miika Turkia wrote:<br>
> I have some trouble understanding this code, but as there is a clear<br>
> bug involved (null dereference), I ask others to verify if I am onto<br>
> something. And if datatrak import still works with this patch.<br>
<br></div></div></blockquote><div> </div><div>Works fine for me Miika.  <br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
</div></div>So this interesting pattern<br>
<br>
+               dt_dive = NULL;<br>
+               return(*dt_dive);<br>
<br>
(which Lubomir improved by removing the unnecessary parenthesis) was in<br>
the original commit 44b55bd1a220 by Salvador Cuñat <<a href="mailto:salvador.cunat@gmail.com">salvador.cunat@gmail.com</a>><br>
<br>
Me thinks that this may never have worked all that well.<br>
<br>
Salvador, any comments on Miika's patch?<br>
<br></blockquote><div><br></div><div>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.<br></div><div>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.<br></div><div>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.<br><br></div><div>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.<br><br></div><div>Regards.<br><br></div><div>Salva.<br><br></div><br></div><br></div></div></div>