Fix json output when bar has no items

This commit is contained in:
Ethan Rose 2021-11-13 18:02:57 -08:00
parent fc3db286b7
commit bbf45f7230

View file

@ -452,6 +452,6 @@ void bar_manager_serialize(struct bar_manager* bar_manager, FILE* rsp) {
for (int i = 0; i < bar_manager->bar_item_count; i++) { for (int i = 0; i < bar_manager->bar_item_count; i++) {
fprintf(rsp, "\t\t \"%s\"", bar_manager->bar_items[i]->name); fprintf(rsp, "\t\t \"%s\"", bar_manager->bar_items[i]->name);
if (i < bar_manager->bar_item_count - 1) fprintf(rsp, ",\n"); if (i < bar_manager->bar_item_count - 1) fprintf(rsp, ",\n");
else fprintf(rsp, "\n\t]\n}\n");
} }
fprintf(rsp, "\n\t]\n}\n");
} }