mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
export-html: prevent invalid json
A dive without events could lead to json with extra closing brackets that prevents browsers from rendering the dive log. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0e7d3a6466
commit
25946f14fb
1 changed files with 2 additions and 1 deletions
|
@ -92,7 +92,8 @@ static void write_dive_status(struct membuffer *b, const struct dive &dive)
|
|||
|
||||
static void put_HTML_bookmarks(struct membuffer *b, const struct dive &dive)
|
||||
{
|
||||
const char *separator = "\"events\":[";
|
||||
const char *separator = "";
|
||||
put_string(b, "\"events\":[");
|
||||
for (const auto &ev: dive.dcs[0].events) {
|
||||
put_string(b, separator);
|
||||
separator = ", ";
|
||||
|
|
Loading…
Reference in a new issue