1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

non-ascii: Prefer while loop rather than a do loop

This also removes the need to check that the 'form' argument is valid.
This commit is contained in:
Steve Holme 2014-12-19 20:38:26 +00:00
parent f2a5283cbc
commit ee9de01665

View File

@ -319,13 +319,10 @@ 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 {
while(form) {
next = form->next; /* the following form line */
if(form->type == FORM_DATA) {
result = Curl_convert_to_network(data, form->line, form->length);
@ -333,7 +330,10 @@ CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
if(result)
return result;
}
} while((form = next) != NULL); /* continue */
form = next;
}
return CURLE_OK;
}