From 10cabcdb6996d98073d16f7476c6057c3fb70dc7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 18 May 2018 11:44:11 +0200 Subject: 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 Signed-off-by: Berthold Stoeger --- core/plannernotes.c | 1 + 1 file changed, 1 insertion(+) (limited to 'core/plannernotes.c') diff --git a/core/plannernotes.c b/core/plannernotes.c index efd71b16c..cf5b682a3 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -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, ""); // 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, "%s %s", -- cgit v1.2.3-70-g09d2