summaryrefslogtreecommitdiff
path: root/lib/non-ascii.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/non-ascii.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/non-ascii.c')
-rw-r--r--lib/non-ascii.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/non-ascii.c b/lib/non-ascii.c
index 91d6a54fc..622d6fc8c 100644
--- a/lib/non-ascii.c
+++ b/lib/non-ascii.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -87,7 +87,7 @@ CURLcode Curl_convert_to_network(struct SessionHandle *data,
if(data->set.convtonetwork) {
/* use translation callback */
rc = data->set.convtonetwork(buffer, length);
- if(rc != CURLE_OK) {
+ if(rc) {
failf(data,
"CURLOPT_CONV_TO_NETWORK_FUNCTION callback returned %d: %s",
(int)rc, curl_easy_strerror(rc));
@@ -148,7 +148,7 @@ CURLcode Curl_convert_from_network(struct SessionHandle *data,
if(data->set.convfromnetwork) {
/* use translation callback */
rc = data->set.convfromnetwork(buffer, length);
- if(rc != CURLE_OK) {
+ if(rc) {
failf(data,
"CURLOPT_CONV_FROM_NETWORK_FUNCTION callback returned %d: %s",
(int)rc, curl_easy_strerror(rc));
@@ -209,7 +209,7 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
if(data->set.convfromutf8) {
/* use translation callback */
rc = data->set.convfromutf8(buffer, length);
- if(rc != CURLE_OK) {
+ if(rc) {
failf(data,
"CURLOPT_CONV_FROM_UTF8_FUNCTION callback returned %d: %s",
(int)rc, curl_easy_strerror(rc));
@@ -333,7 +333,7 @@ CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
if(form->type == FORM_DATA) {
rc = Curl_convert_to_network(data, form->line, form->length);
/* Curl_convert_to_network calls failf if unsuccessful */
- if(rc != CURLE_OK)
+ if(rc)
return rc;
}
} while((form = next) != NULL); /* continue */