Browse Source

And make JSON valid again

For strange reasons JSON parsers are unhappy if you forget the quotes
around strings. No clue why..... *G*
Petschge 9 years ago
parent
commit
685b5fac8d
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      gitter/json_output.c

+ 1
- 1
gitter/json_output.c View File

@@ -58,7 +58,7 @@ void json_output(cluster_t* planets, int n_planets) {
58 58
 			for(j = 0; j < i%7; j++) {
59 59
 				contents[j] = 'R';
60 60
 			}
61
-			printf("      {\"id\":%d, \"x\": %f, \"y\": %f, \"contents\": %s}%s\n", i+1, planets[i].center.x, planets[i].center.y, contents, asteroidseen < asteroidmax-1 ? "," : "");
61
+			printf("      {\"id\":%d, \"x\": %f, \"y\": %f, \"contents\": \"%s\"}%s\n", i+1, planets[i].center.x, planets[i].center.y, contents, asteroidseen < asteroidmax-1 ? "," : "");
62 62
 			asteroidseen++;
63 63
 		}
64 64
 	}