Extra step for thread safety

Nothing breaks, but it still overreads the error data for cJSON unless we use ParseWithLengthOpts (I set the error value to NULL for now, this might bite me in the ass later)

FossilOrigin-Name: 6451d34540d66e921d5f94a7da49c688dee82ed0aaf5b63b1a101dd91f71e6b1
master
nekobit 2 months ago
parent bb494dd06b
commit ee32bdf4d0
  1. 2
      src/json_helper.c

@ -27,7 +27,7 @@ int _mstdnt_json_init(cJSON** root,
struct mstdnt_fetch_results* results,
struct mstdnt_storage* storage)
{
*root = cJSON_ParseWithLength(results->response, results->size);
*root = cJSON_ParseWithLengthOpts(results->response, results->size, NULL, 0);
storage->root = *root;
if (*root == NULL)
return 1;

Loading…
Cancel
Save