ANSI C requires struct initializers to be constant expressions
authorPetri Lehtinen <petri@digip.org>
Mon, 21 Mar 2011 07:27:51 +0000 (09:27 +0200)
committerPetri Lehtinen <petri@digip.org>
Mon, 21 Mar 2011 07:28:14 +0000 (09:28 +0200)
Closes GH-17.

src/load.c

index 262bd7d..3cc7d0f 100644 (file)
@@ -839,10 +839,13 @@ json_t *json_loads(const char *string, size_t flags, json_error_t *error)
 {
     lex_t lex;
     json_t *result;
-    string_data_t stream_data = {string, 0};
+    string_data_t stream_data;
 
     (void)flags; /* unused */
 
+    stream_data.data = string;
+    stream_data.pos = 0;
+
     if(lex_init(&lex, string_get, (void *)&stream_data))
         return NULL;