X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c08cb60fe34b42b0a83bc88b57fd41b07793863f..14e7f92ac37c70e4267e8602a036aa4e08a09447:/sbr/oauth.c diff --git a/sbr/oauth.c b/sbr/oauth.c index 3aeeccbe..ec485cdf 100755 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -945,7 +945,7 @@ post(struct curl_ctx *ctx, const char *url, const char *req_body) curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx->log); } - if ((status = curl_easy_setopt(curl, CURLOPT_URL, url)) != CURLE_OK) { + if (curl_easy_setopt(curl, CURLOPT_URL, url) != CURLE_OK) { return false; } @@ -971,14 +971,10 @@ post(struct curl_ctx *ctx, const char *url, const char *req_body) return false; } - if ((status = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, - &ctx->res_code)) != CURLE_OK - || (status = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, - &ctx->content_type)) != CURLE_OK) { - return false; - } - - return true; + return curl_easy_getinfo(curl, + CURLINFO_RESPONSE_CODE, &ctx->res_code) == CURLE_OK && + curl_easy_getinfo(curl, + CURLINFO_CONTENT_TYPE, &ctx->content_type) == CURLE_OK; } /******************************************************************************* @@ -1019,11 +1015,8 @@ parse_json(jsmntok_t **tokens, size_t *tokens_len, of the response body. */ *tokens = mh_xrealloc(*tokens, *tokens_len * sizeof **tokens); } - if (r <= 0) { - return false; - } - return true; + return r > 0; } /*