Planner: Bug in PR by bstoeger

Willem Ferguson willemferguson at
Fri May 18 01:30:28 PDT 2018

Hallo Berthold,

On March 14th you introduced a PR entitled Cleanup: fix "unsave" 
snprintf()s in plannernotes.c 
for Subsurface.

This PR affected the function  add_icd_entry() in plannernotes.c. The 
changes, unfortunately, introduced a bug in the display of the icd data 
for a dive. I include a sample dive plan so that you can see the effect 
of this change in code. Activate the display of icd data in Preferences, 
open the attached dive plan and edit the dive plan within the planner. 
You will see random information being added to the icd data. In fact the 
icd data are quite messed up because the table should include two lines 
of gas change information. At least part of the problem lies in lines 
55-68 of plannernotes.c.

I spent a bit of time trying to track down the problem, but it appears 
to be a pointer that writes to a buffer where it should not write to.

Would you be prepared at all to look at this issue?

Kind regards,


This message and attachments are subject to a disclaimer.

Please refer to 
<> for
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t1.xml
Type: text/xml
Size: 15117 bytes
Desc: not available
URL: <>

More information about the subsurface mailing list