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:
@@ -319,21 +319,21 @@ CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
|
|||||||
struct FormData *next;
|
struct FormData *next;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
|
|
||||||
if(!form)
|
|
||||||
return CURLE_OK;
|
|
||||||
|
|
||||||
if(!data)
|
if(!data)
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
|
|
||||||
do {
|
while(form) {
|
||||||
next=form->next; /* the following form line */
|
next = form->next; /* the following form line */
|
||||||
if(form->type == FORM_DATA) {
|
if(form->type == FORM_DATA) {
|
||||||
result = Curl_convert_to_network(data, form->line, form->length);
|
result = Curl_convert_to_network(data, form->line, form->length);
|
||||||
/* Curl_convert_to_network calls failf if unsuccessful */
|
/* Curl_convert_to_network calls failf if unsuccessful */
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
} while((form = next) != NULL); /* continue */
|
|
||||||
|
form = next;
|
||||||
|
}
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user