From efa4816371ed9bcea5791b3cbe96f825cb8d008c Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Tue, 3 Mar 2020 10:36:01 -0500 Subject: [PATCH] Properly-form JSON output. --- src/queue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/queue.c b/src/queue.c index 8b76926c..4dc8ea21 100644 --- a/src/queue.c +++ b/src/queue.c @@ -452,13 +452,17 @@ static int CalculateNextTimeUsingSched(QueuedRem *q) static void json_queue(QueuedRem const *q) { + int done = 0; printf("["); while(q) { if (q->tt.nexttime == NO_TIME) { q = q->next; continue; } - + if (done) { + printf(","); + } + done = 1; printf("{"); switch(q->typ) { case NO_TYPE: PrintJSONKeyPairString("type", "NO_TYPE"); break;