summaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-23 22:56:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-24 08:23:19 +0200
commit0eb3d15ccb419bfda41ee31bdbf73c36facc7388 (patch)
tree0c4abf7bf4bac279cbcfd708e1cdd1bcdf29bb77 /lib/formdata.c
parent1752e9c088d9bb7a3156dba9c66f7f64dd87afa9 (diff)
downloadcurl-0eb3d15ccb419bfda41ee31bdbf73c36facc7388.tar.gz
code cleanup: we prefer 'CURLcode result'
... for the local variable name in functions holding the return code. Using the same name universally makes code easier to read and follow. Also, unify code for checking for CURLcode errors with: if(result) or if(!result) instead of if(result == CURLE_OK), if(CURLE_OK == result) or if(result != CURLE_OK)
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index a5ee54602..1abfbc42b 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -950,13 +950,13 @@ void Curl_formclean(struct FormData **form_ptr)
int curl_formget(struct curl_httppost *form, void *arg,
curl_formget_callback append)
{
- CURLcode rc;
+ CURLcode result;
curl_off_t size;
struct FormData *data, *ptr;
- rc = Curl_getformdata(NULL, &data, form, NULL, &size);
- if(rc != CURLE_OK)
- return (int)rc;
+ result = Curl_getformdata(NULL, &data, form, NULL, &size);
+ if(result)
+ return (int)result;
for(ptr = data; ptr; ptr = ptr->next) {
if((ptr->type == FORM_FILE) || (ptr->type == FORM_CALLBACK)) {
@@ -1365,10 +1365,8 @@ CURLcode Curl_getformdata(struct SessionHandle *data,
} while((post = post->next) != NULL); /* for each field */
/* end-boundary for everything */
- if(CURLE_OK == result)
- result = AddFormDataf(&form, &size,
- "\r\n--%s--\r\n",
- boundary);
+ if(!result)
+ result = AddFormDataf(&form, &size, "\r\n--%s--\r\n", boundary);
if(result) {
Curl_formclean(&firstform);