Avoid Metaware's High-C warning "'=' encountered where '==' may have been intended."
This commit is contained in:
Родитель
59cf6fd4f0
Коммит
4031eb1d91
|
@ -106,7 +106,7 @@ static char *unescape_word(struct SessionHandle *data, char *inp)
|
|||
/* According to RFC2229 section 2.2, these letters need to be escaped with
|
||||
\[letter] */
|
||||
for(ptr = newp;
|
||||
(byte = (unsigned char)*ptr);
|
||||
(byte = (unsigned char)*ptr) != 0;
|
||||
ptr++) {
|
||||
if ((byte <= 32) || (byte == 127) ||
|
||||
(byte == '\'') || (byte == '\"') || (byte == '\\')) {
|
||||
|
|
|
@ -528,8 +528,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
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
|
||||
|
@ -562,8 +562,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
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
|
||||
|
@ -614,9 +614,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
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
|
||||
|
@ -884,7 +884,7 @@ void Curl_formclean(struct FormData *form)
|
|||
free(form->line); /* free the line */
|
||||
free(form); /* free the struct */
|
||||
|
||||
} while((form=next)); /* continue */
|
||||
} while ((form = next) != NULL); /* continue */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -961,7 +961,7 @@ void curl_formfree(struct curl_httppost *form)
|
|||
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
|
||||
|
@ -1231,7 +1231,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||
*/
|
||||
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;
|
||||
|
@ -1268,7 +1268,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||
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);
|
||||
|
@ -1286,7 +1286,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||
break;
|
||||
}
|
||||
|
||||
} while((post=post->next)); /* for each field */
|
||||
} while ((post = post->next) != NULL); /* for each field */
|
||||
if (result) {
|
||||
Curl_formclean(firstform);
|
||||
free(boundary);
|
||||
|
|
|
@ -138,8 +138,10 @@ static int ftp_need_type(struct connectdata *conn,
|
|||
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)
|
||||
{
|
||||
|
@ -3878,7 +3880,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||
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);
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
|
|||
/* no input == no output! */
|
||||
return NULL;
|
||||
|
||||
for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]); i++) {
|
||||
for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) {
|
||||
|
||||
ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче