ANSI C requires struct initializers to be constant expressions
Closes GH-17.
This commit is contained in:
parent
6ecba84817
commit
c30e92603c
@ -839,10 +839,13 @@ json_t *json_loads(const char *string, size_t flags, json_error_t *error)
|
|||||||
{
|
{
|
||||||
lex_t lex;
|
lex_t lex;
|
||||||
json_t *result;
|
json_t *result;
|
||||||
string_data_t stream_data = {string, 0};
|
string_data_t stream_data;
|
||||||
|
|
||||||
(void)flags; /* unused */
|
(void)flags; /* unused */
|
||||||
|
|
||||||
|
stream_data.data = string;
|
||||||
|
stream_data.pos = 0;
|
||||||
|
|
||||||
if(lex_init(&lex, string_get, (void *)&stream_data))
|
if(lex_init(&lex, string_get, (void *)&stream_data))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user