Skip to content

Commit

Permalink
Kitura/Kitura-CouchDB#58 Remove check on uninitialized variable (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
na-gupta committed Jun 20, 2017
1 parent 2af6624 commit 2fbf646
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions shim.h
Expand Up @@ -56,24 +56,18 @@ static inline CURLcode curlHelperSetOptReadFunc(CURL *curl, void *userData, size

static inline CURLcode curlHelperSetOptWriteFunc(CURL *curl, void *userData, size_t (*write_cb) (char *ptr, size_t size, size_t nmemb, void *userdata)) {

CURLcode rc;
if (rc == CURLE_OK) {
rc = curl_easy_setopt(curl, CURLOPT_WRITEDATA, userData);
if (rc == CURLE_OK) {
rc = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
}
CURLcode rc = curl_easy_setopt(curl, CURLOPT_WRITEDATA, userData);
if (rc == CURLE_OK) {
rc = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
}
return rc;
}

static inline CURLcode curlHelperSetOptHeaderFunc(CURL *curl, void *userData, size_t (*header_cb) (char *buffer, size_t size, size_t nmemb, void *userdata)) {

CURLcode rc;
CURLcode rc = curl_easy_setopt(curl, CURLOPT_HEADERDATA, userData);
if (rc == CURLE_OK) {
rc = curl_easy_setopt(curl, CURLOPT_HEADERDATA, userData);
if (rc == CURLE_OK) {
rc = curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_cb);
}
rc = curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_cb);
}
return rc;
}
Expand Down

0 comments on commit 2fbf646

Please sign in to comment.