Uninitialized variable in profile.c

Robert Helling helling at atdotde.de
Sun Dec 17 08:06:06 PST 2017


Hi,

> On 17. Dec 2017, at 14:19, Berthold Stoeger <bstoeger at mail.tuwien.ac.at> wrote:
> 
> There is another warning concerning entry in l.807. To make the warning go
> away, you could add a
>  if (pi->nr <= 0)
>    return;
> block before the loop. Even if pi->nr can never be <= 0, this seems like a
> good idea for robustness' sake.

isn’t that what

assert(pi->nr >= 0);

is for?

Best
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171217/6e1bab0f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 529 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171217/6e1bab0f/attachment.sig>


More information about the subsurface mailing list