Skip to content

Commit 63ea327

Browse files
committed
Minor, whitespace adjustments in JSON output
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent b3f35c3 commit 63ea327

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/bridge.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void bridge_prop(FILE *fp, char *prop, int setval)
294294

295295
for (int i = 0; i < num; i++) {
296296
logit(LOG_DEBUG, 0, "Array val: %s, index: %d", array[i], i);
297-
fprintf(fp, "%s%s", i ? ", " : "", array[i]);
297+
fprintf(fp, "%s%s", i ? ", " : " ", array[i]);
298298
}
299299

300300
out:
@@ -390,9 +390,9 @@ void bridge_router_ports(FILE *fp)
390390
logit(LOG_DEBUG, 0, "Found router port %s with %.2f s timeout\n", ifname, timer);
391391
if (timer > 0.0 && !seen) {
392392
if (json)
393-
fprintf(fp, "%s\"%s\"", num ? ", " : "", ifname);
393+
fprintf(fp, "%s\"%s\"", num ? ", " : " ", ifname);
394394
else
395-
fprintf(fp, "%s%s", num ? ", " : "", ifname);
395+
fprintf(fp, "%s%s", num ? ", " : " ", ifname);
396396
num++;
397397
memcpy(prev_ifname, ifname, sizeof(prev_ifname));
398398
}

src/ipc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,21 +409,21 @@ static int show_igmp(FILE *fp)
409409
show_status(fp);
410410

411411
if (json) {
412-
fprintf(fp, ",\n%*s\"fast-leave-ports\": [ ", prefix, "");
412+
fprintf(fp, ",\n%*s\"fast-leave-ports\": [", prefix, "");
413413
bridge_prop(fp, "multicast_fast_leave", 1);
414-
fprintf(fp, "],\n");
414+
fprintf(fp, " ],\n");
415415

416-
fprintf(fp, "%*s\"multicast-router-ports\": [ ", prefix, "");
416+
fprintf(fp, "%*s\"multicast-router-ports\": [", prefix, "");
417417
bridge_router_ports(fp);
418-
fprintf(fp, "],\n");
418+
fprintf(fp, " ],\n");
419419

420-
fprintf(fp, "%*s\"multicast-flood-ports\": [ ", prefix, "");
420+
fprintf(fp, "%*s\"multicast-flood-ports\": [", prefix, "");
421421
bridge_prop(fp, "multicast_flood", 1);
422-
fprintf(fp, "]");
422+
fprintf(fp, " ]");
423423
} else {
424-
fprintf(fp, "%-23s : ", "Fast Leave Ports"); bridge_prop(fp, "multicast_fast_leave", 1);
425-
fprintf(fp, "%-23s : ", "Router Ports"); bridge_router_ports(fp);
426-
fprintf(fp, "%-23s : ", "Flood Ports"); bridge_prop(fp, "multicast_flood", 1);
424+
fprintf(fp, "%-23s :", "Fast Leave Ports"); bridge_prop(fp, "multicast_fast_leave", 1);
425+
fprintf(fp, "%-23s :", "Router Ports"); bridge_router_ports(fp);
426+
fprintf(fp, "%-23s :", "Flood Ports"); bridge_prop(fp, "multicast_flood", 1);
427427
fprintf(fp, "\n");
428428
}
429429

0 commit comments

Comments
 (0)