On Fri, 21 Jan 2022, Gavin Henry via curl-library wrote:

      json_t *json = outstream;
      json = json_loadb(buffer, size * nmemb, 0, NULL);

"The value is never used". I'll leave gcc and clang to sort.

The first statement here is pointless since you discard the contents and assign it again in the second line, which doesn't look right. I think you probably want something similar to:

       json_t **json = outstream;
       *json = json_loadb(buffer, size * nmemb, 0, NULL);

Because outside of the callback you pass do:

        json_t *json = 0;
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &json);

... so that's a pointer to a pointer.

--

 / daniel.haxx.se
 | Commercial curl support up to 24x7 is available!
 | Private help, bug fixes, support, ports, new features
 | https://curl.se/support.html
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to