[PATCH 7/7] Do not use curl_easy_strerror with curl < 7.12.0
- From
Tom G. Christensen <tgc@jupiterrise.com>
- Date
- Apr 5, 2017, 13:04 UTC
- Message-ID
- <20170405130424.13803-8-tgc@jupiterrise.com>
- In-Reply-To
- <20170405130424.13803-1-tgc@jupiterrise.com>
Commit 17966c0a added an unguarded use of curl_easy_strerror. This adds a guard so it is not used with curl < 7.12.0.
Signed-off-by: Tom G. Christensen <tgc@jupiterrise.com> --- http.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/http.c b/http.c index a46ab23af..104caaa75 100644 --- a/http.c +++ b/http.c @@ -2116,8 +2116,12 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize, size_t nmemb, CURLcode c = curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code); if (c != CURLE_OK) +#if LIBCURL_VERSION_NUM >= 0x070c00 die("BUG: curl_easy_getinfo for HTTP code failed: %s", curl_easy_strerror(c)); +#else + die("BUG: curl_easy_getinfo for HTTP code failed"); +#endif if (slot->http_code >= 300) return size; }
-- 2.12.2