mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
When CURLINFO_CONTENT_TYPE returns a NULL pointer, don't try to fputs() it!
This commit is contained in:
parent
99dfdebc64
commit
dafd81178f
@ -111,8 +111,9 @@ void ourWriteOut(CURL *curl, char *writeinfo)
|
|||||||
if(strequal(ptr, replacements[i].name)) {
|
if(strequal(ptr, replacements[i].name)) {
|
||||||
switch(replacements[i].id) {
|
switch(replacements[i].id) {
|
||||||
case VAR_EFFECTIVE_URL:
|
case VAR_EFFECTIVE_URL:
|
||||||
if(CURLE_OK ==
|
if((CURLE_OK ==
|
||||||
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp))
|
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp))
|
||||||
|
&& stringp)
|
||||||
fputs(stringp, stream);
|
fputs(stringp, stream);
|
||||||
break;
|
break;
|
||||||
case VAR_HTTP_CODE:
|
case VAR_HTTP_CODE:
|
||||||
@ -177,8 +178,9 @@ void ourWriteOut(CURL *curl, char *writeinfo)
|
|||||||
fprintf(stream, "%.3f", doubleinfo);
|
fprintf(stream, "%.3f", doubleinfo);
|
||||||
break;
|
break;
|
||||||
case VAR_CONTENT_TYPE:
|
case VAR_CONTENT_TYPE:
|
||||||
if(CURLE_OK ==
|
if((CURLE_OK ==
|
||||||
curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp))
|
curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp))
|
||||||
|
&& stringp)
|
||||||
fputs(stringp, stream);
|
fputs(stringp, stream);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user