diff --git a/lib/file.c b/lib/file.c index b88f612305..297503edcc 100644 --- a/lib/file.c +++ b/lib/file.c @@ -358,7 +358,7 @@ static CURLcode file_upload(struct Curl_easy *data, return CURLE_WRITE_ERROR; } - if(-1 != data->state.infilesize) + if(data->state.infilesize != -1) /* known size of data to "upload" */ Curl_pgrsSetUploadSize(data, data->state.infilesize); @@ -470,7 +470,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) fd = file->fd; /* VMS: This only works reliable for STREAMLF files */ - if(-1 != fstat(fd, &statbuf)) { + if(fstat(fd, &statbuf) != -1) { if(!S_ISDIR(statbuf.st_mode)) expected_size = statbuf.st_size; /* and store the modification time */ diff --git a/lib/ftp.c b/lib/ftp.c index f763b183b1..dc90e5a595 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -2356,7 +2356,7 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, if(instate == FTP_SIZE) { #ifdef CURL_FTP_HTTPSTYLE_HEAD - if(-1 != filesize) { + if(filesize != -1) { char clbuf[128]; int clbuflen = msnprintf(clbuf, sizeof(clbuf), "Content-Length: %" FMT_OFF_T "\r\n", filesize); @@ -3439,7 +3439,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, } } else { - if((-1 != data->req.size) && + if((data->req.size != -1) && (data->req.size != data->req.bytecount) && (data->req.maxdownload != data->req.bytecount)) { failf(data, "Received only partial file: %" FMT_OFF_T " bytes", diff --git a/lib/sendf.c b/lib/sendf.c index 9b6908f92d..6bd4b1bfba 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -281,7 +281,7 @@ static CURLcode cw_download_write(struct Curl_easy *data, * This gives deterministic BODY writes on varying buffer receive * lengths. */ nwrite = nbytes; - if(-1 != data->req.maxdownload) { + if(data->req.maxdownload != -1) { size_t wmax = get_max_body_write_len(data, data->req.maxdownload); if(nwrite > wmax) { excess_len = nbytes - wmax; @@ -879,7 +879,7 @@ static CURLcode cr_in_rewind(struct Curl_easy *data, int err = fseek(data->state.in, 0, SEEK_SET); CURL_TRC_READ(data, "cr_in, rewind via fseek -> %d(%d)", (int)err, (int)errno); - if(-1 != err) + if(err != -1) /* successful rewind */ return CURLE_OK; } diff --git a/src/tool_filetime.c b/src/tool_filetime.c index f4ff3a4291..d94df35346 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -76,7 +76,7 @@ int getfiletime(const char *filename, struct GlobalConfig *global, } #else struct_stat statbuf; - if(-1 != stat(filename, &statbuf)) { + if(stat(filename, &statbuf) != -1) { *stamp = (curl_off_t)statbuf.st_mtime; rc = 0; }