diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-12-31 11:11:34 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-12-31 11:20:41 +0000 |
commit | 4c8a0538550d45f11aa359c6934b6fe0594fe0ed (patch) | |
tree | 138b3a13d79f6c223044c02438dc77b9613cd1bb /docs | |
parent | 8a3c0fbed1dc0a09f1d53579a0112b546cd3d76d (diff) |
sepheaders.c: Applied curl oding standards
Diffstat (limited to 'docs')
-rw-r--r-- | docs/examples/sepheaders.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index e085f5177..7402e3542 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -53,24 +53,26 @@ int main(void) /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data); - /* open the files */ - headerfile = fopen(headerfilename,"wb"); - if (headerfile == NULL) { + /* open the header file */ + headerfile = fopen(headerfilename, "wb"); + if(!headerfile) { curl_easy_cleanup(curl_handle); return -1; } - bodyfile = fopen(bodyfilename,"wb"); - if (bodyfile == NULL) { + + /* open the body file */ + bodyfile = fopen(bodyfilename, "wb"); + if(!bodyfile) { curl_easy_cleanup(curl_handle); fclose(headerfile); return -1; } /* we want the headers be written to this file handle */ - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, headerfile); + curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, headerfile); /* we want the body be written to this file handle instead of stdout */ - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); /* get it! */ curl_easy_perform(curl_handle); |