aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-07-30 11:07:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-07-30 11:07:59 +0000
commitdafd81178fd739b101ea4441171f929874e96f61 (patch)
tree9b811768302ce070a40dc590cdb5059dd1eb76b0 /src
parent99dfdebc64f6cfc72dc8ead6538ec9564610e1a9 (diff)
When CURLINFO_CONTENT_TYPE returns a NULL pointer, don't try to fputs() it!
Diffstat (limited to 'src')
-rw-r--r--src/writeout.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/writeout.c b/src/writeout.c
index bf7393799..029de80c1 100644
--- a/src/writeout.c
+++ b/src/writeout.c
@@ -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;
}