Skip to content
Snippets Groups Projects
Commit dafd8117 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

When CURLINFO_CONTENT_TYPE returns a NULL pointer, don't try to fputs() it!

parent 99dfdebc
No related branches found
No related tags found
No related merge requests found
......@@ -111,8 +111,9 @@ void ourWriteOut(CURL *curl, char *writeinfo)
if(strequal(ptr, replacements[i].name)) {
switch(replacements[i].id) {
case VAR_EFFECTIVE_URL:
if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp))
if((CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp))
&& stringp)
fputs(stringp, stream);
break;
case VAR_HTTP_CODE:
......@@ -177,10 +178,11 @@ void ourWriteOut(CURL *curl, char *writeinfo)
fprintf(stream, "%.3f", doubleinfo);
break;
case VAR_CONTENT_TYPE:
if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp))
fputs(stringp, stream);
break;
if((CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp))
&& stringp)
fputs(stringp, stream);
break;
default:
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment