summaryrefslogtreecommitdiff
path: root/lib/non-ascii.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-12-19 20:38:26 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-12-20 12:47:09 +0000
commitee9de01665b30ec03648c946702c5320f2096f51 (patch)
tree4a3ec0d2f12331aeb0bda3bcaf08cc94e0b5f24b /lib/non-ascii.c
parentf2a5283cbcd564518d4189630ab26ce739bf67b1 (diff)
downloadcurl-ee9de01665b30ec03648c946702c5320f2096f51.tar.gz
non-ascii: Prefer while loop rather than a do loop
This also removes the need to check that the 'form' argument is valid.
Diffstat (limited to 'lib/non-ascii.c')
-rw-r--r--lib/non-ascii.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/non-ascii.c b/lib/non-ascii.c
index ef6a82cea..6c0f9e5a4 100644
--- a/lib/non-ascii.c
+++ b/lib/non-ascii.c
@@ -319,21 +319,21 @@ CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
struct FormData *next;
CURLcode result;
- if(!form)
- return CURLE_OK;
-
if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
- do {
- next=form->next; /* the following form line */
+ while(form) {
+ next = form->next; /* the following form line */
if(form->type == FORM_DATA) {
result = Curl_convert_to_network(data, form->line, form->length);
/* Curl_convert_to_network calls failf if unsuccessful */
if(result)
return result;
}
- } while((form = next) != NULL); /* continue */
+
+ form = next;
+ }
+
return CURLE_OK;
}