1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Avoid Metaware's High-C warning "'=' encountered where '==' may have been intended."

This commit is contained in:
Gisle Vanem 2006-08-29 21:11:55 +00:00
parent 59cf6fd4f0
commit 4031eb1d91
4 changed files with 19 additions and 17 deletions

View File

@ -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 /* According to RFC2229 section 2.2, these letters need to be escaped with
\[letter] */ \[letter] */
for(ptr = newp; for(ptr = newp;
(byte = (unsigned char)*ptr); (byte = (unsigned char)*ptr) != 0;
ptr++) { ptr++) {
if ((byte <= 32) || (byte == 127) || if ((byte <= 32) || (byte == 127) ||
(byte == '\'') || (byte == '\"') || (byte == '\\')) { (byte == '\'') || (byte == '\"') || (byte == '\\')) {

View File

@ -528,8 +528,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->value) { if (current_form->value) {
if (current_form->flags & HTTPPOST_FILENAME) { if (current_form->flags & HTTPPOST_FILENAME) {
if (filename) { if (filename) {
if (!(current_form = AddFormInfo(strdup(filename), if ((current_form = AddFormInfo(strdup(filename),
NULL, current_form))) NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY; return_value = CURL_FORMADD_MEMORY;
} }
else else
@ -562,8 +562,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->value) { if (current_form->value) {
if (current_form->flags & HTTPPOST_BUFFER) { if (current_form->flags & HTTPPOST_BUFFER) {
if (filename) { if (filename) {
if (!(current_form = AddFormInfo(strdup(filename), if ((current_form = AddFormInfo(strdup(filename),
NULL, current_form))) NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY; return_value = CURL_FORMADD_MEMORY;
} }
else else
@ -614,9 +614,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->contenttype) { if (current_form->contenttype) {
if (current_form->flags & HTTPPOST_FILENAME) { if (current_form->flags & HTTPPOST_FILENAME) {
if (contenttype) { if (contenttype) {
if (!(current_form = AddFormInfo(NULL, if ((current_form = AddFormInfo(NULL,
strdup(contenttype), strdup(contenttype),
current_form))) current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY; return_value = CURL_FORMADD_MEMORY;
} }
else else
@ -884,7 +884,7 @@ void Curl_formclean(struct FormData *form)
free(form->line); /* free the line */ free(form->line); /* free the line */
free(form); /* free the struct */ 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->showfilename); /* free the faked file name */
free(form); /* free the struct */ free(form); /* free the struct */
} while((form=next)); /* continue */ } while ((form = next) != NULL); /* continue */
} }
#ifndef HAVE_BASENAME #ifndef HAVE_BASENAME
@ -1231,7 +1231,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
*/ */
size_t nread; size_t nread;
char buffer[512]; 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); result = AddFormData(&form, FORM_DATA, buffer, nread, &size);
if (result) if (result)
break; break;
@ -1268,7 +1268,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
if (result) if (result)
break; 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) { if (result) {
Curl_formclean(firstform); Curl_formclean(firstform);
free(boundary); free(boundary);
@ -1286,7 +1286,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
break; break;
} }
} while((post=post->next)); /* for each field */ } while ((post = post->next) != NULL); /* for each field */
if (result) { if (result) {
Curl_formclean(firstform); Curl_formclean(firstform);
free(boundary); free(boundary);

View File

@ -138,8 +138,10 @@ static int ftp_need_type(struct connectdata *conn,
bool ascii); bool ascii);
/* easy-to-use macro: */ /* easy-to-use macro: */
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result #define FTPSENDF(x,y,z) if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
#define NBFTPSENDF(x,y,z) if((result = Curl_nbftpsendf(x,y,z))) return result return result
#define NBFTPSENDF(x,y,z) if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \
return result
static void freedirs(struct FTP *ftp) static void freedirs(struct FTP *ftp)
{ {
@ -3878,7 +3880,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
/* parse the URL path into separate path components */ /* 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 */ /* 1 or 0 to indicate absolute directory */
bool absolute_dir = (cur_pos - conn->path > 0) && (ftp->dirdepth == 0); bool absolute_dir = (cur_pos - conn->path > 0) && (ftp->dirdepth == 0);

View File

@ -348,7 +348,7 @@ Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
/* no input == no output! */ /* no input == no output! */
return NULL; 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)); ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in));