Plannernotes: '\0'-terminate ICD-buffer

When creating the ICD-notes the membuffer was not '\0'-terminated,
leading to output of stale data.

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-05-18 11:44:11 +02:00 committed by Lubomir I. Ivanov
parent 21bf811a57
commit 10cabcdb69

View file

@ -524,6 +524,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
/* For trimix OC dives, if an icd table header and icd data were printed to buffer, then add the ICD table here */
if (!icdtableheader && prefs.show_icd) {
put_string(&icdbuf, "</tbody></table>"); // End the ICD table
mb_cstring(&icdbuf);
put_string(&buf, icdbuf.buffer); // ..and add it to the html buffer
if (icdwarning) { // If necessary, add warning
put_format(&buf, "<span style='color: red;'>%s</span> %s",