if (current_form->value) {
if (current_form->flags & HTTPPOST_FILENAME) {
if (filename) {
- if (!(current_form = AddFormInfo(strdup(filename),
- NULL, current_form)))
+ if ((current_form = AddFormInfo(strdup(filename),
+ NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
if (current_form->value) {
if (current_form->flags & HTTPPOST_BUFFER) {
if (filename) {
- if (!(current_form = AddFormInfo(strdup(filename),
- NULL, current_form)))
+ if ((current_form = AddFormInfo(strdup(filename),
+ NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
if (current_form->contenttype) {
if (current_form->flags & HTTPPOST_FILENAME) {
if (contenttype) {
- if (!(current_form = AddFormInfo(NULL,
- strdup(contenttype),
- current_form)))
+ if ((current_form = AddFormInfo(NULL,
+ strdup(contenttype),
+ current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
free(form->line); /* free the line */
free(form); /* free the struct */
- } while((form=next)); /* continue */
+ } while ((form = next) != NULL); /* continue */
}
/*
free(form->showfilename); /* free the faked file name */
free(form); /* free the struct */
- } while((form=next)); /* continue */
+ } while ((form = next) != NULL); /* continue */
}
#ifndef HAVE_BASENAME
*/
size_t nread;
char buffer[512];
- while((nread = fread(buffer, 1, sizeof(buffer), fileread))) {
+ while ((nread = fread(buffer, 1, sizeof(buffer), fileread)) != 0) {
result = AddFormData(&form, FORM_DATA, buffer, nread, &size);
if (result)
break;
if (result)
break;
}
- } while((file = file->more)); /* for each specified file for this field */
+ } while ((file = file->more) != NULL); /* for each specified file for this field */
if (result) {
Curl_formclean(firstform);
free(boundary);
break;
}
- } while((post=post->next)); /* for each field */
+ } while ((post = post->next) != NULL); /* for each field */
if (result) {
Curl_formclean(firstform);
free(boundary);
bool ascii);
/* easy-to-use macro: */
-#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result
-#define NBFTPSENDF(x,y,z) if((result = Curl_nbftpsendf(x,y,z))) return result
+#define FTPSENDF(x,y,z) if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
+ return result
+#define NBFTPSENDF(x,y,z) if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \
+ return result
static void freedirs(struct FTP *ftp)
{
return CURLE_OUT_OF_MEMORY;
/* parse the URL path into separate path components */
- while((slash_pos=strchr(cur_pos, '/'))) {
+ while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
/* 1 or 0 to indicate absolute directory */
bool absolute_dir = (cur_pos - conn->path > 0) && (ftp->dirdepth == 0);