Commit ee9de016 authored by Steve Holme's avatar Steve Holme
Browse files

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

This also removes the need to check that the 'form' argument is valid.
parent f2a5283c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;
}