After debugging a bit, it seems the error is occuring within the 'Json_create(const char* value)' function:
/* Parse an object - create a new root, and populate. */
Json Json_create (const char value) {
Json c;
ep = 0;
if (!value) return 0; / only place we check for NULL other than skip() /
c = Json_new();
if (!c) return 0; / memory fail */
value = parse_value(c, skip(value));
if (!value) {
Json_dispose(c);
return 0;
} /* parse failure. ep is set. */
return c;
}
More specifically, when it hits 'parse_value(c, skip(value));' and dives into the parse_value function which eventually returns 0:
/* Parser core - when encountering text, process appropriately. /
static const char parse_value (Json item, const char value) {
/* Referenced by Json_create(), parse_array(), and parse_object(). /
/ Always called with the result of skip(). /
#if SPINE_JSON_DEBUG / Checked at entry to graph, Json_create, and after every parse_ call. /
if (!value) return 0; / Fail on null. */
#endif
switch (*value) {
case 'n': {
if (!strncmp(value + 1, "ull", 3)) {
item->type = Json_NULL;
return value + 4;
}
break;
}
case 'f': {
if (!strncmp(value + 1, "alse", 4)) {
item->type = Json_False;
/* calloc prevents us needing item->type = Json_False or valueInt = 0 here */
return value + 5;
}
break;
}
case 't': {
if (!strncmp(value + 1, "rue", 3)) {
item->type = Json_True;
item->valueInt = 1;
return value + 4;
}
break;
}
case '\"':
return parse_string(item, value);
case '[':
return parse_array(item, value);
case '{':
return parse_object(item, value);
case '-': /* fallthrough */
case '0': /* fallthrough */
case '1': /* fallthrough */
case '2': /* fallthrough */
case '3': /* fallthrough */
case '4': /* fallthrough */
case '5': /* fallthrough */
case '6': /* fallthrough */
case '7': /* fallthrough */
case '8': /* fallthrough */
case '9':
return parse_number(item, value);
default:
break;
}
ep = value;
return 0; /* failure. */
}
So none of the switch cases are hit. When inspecting the const char* 'value' variable, its says it's holding the 'spineboy-ess.json' file name within it, so it's not like that variable is null or anything.