tidy-up: move literal to the right side of comparisons

Closes #17876
This commit is contained in:
Viktor Szakats 2025-07-08 14:10:35 +02:00
parent 08f97cbf5c
commit b2bccdc257
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
49 changed files with 113 additions and 113 deletions

View file

@ -61,7 +61,7 @@ static int my_seek(void *userp, curl_off_t offset, int origin)
{
FILE *fp = (FILE *) userp;
if(-1 == fseek(fp, (long) offset, origin))
if(fseek(fp, (long) offset, origin) == -1)
/* could not seek */
return CURL_SEEKFUNC_CANTSEEK;

View file

@ -155,7 +155,7 @@ static struct ip *ip_list_append(struct ip *list, const char *data)
ip->maskbits = 128;
#endif
if(1 != inet_pton(ip->family, ip->str, &ip->netaddr)) {
if(inet_pton(ip->family, ip->str, &ip->netaddr) != 1) {
free(ip->str);
free(ip);
return NULL;

View file

@ -80,7 +80,7 @@ int main(void)
NULL, /* default attributes please */
pull_one_url,
(void *)urls[i]);
if(0 != error)
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);

View file

@ -83,7 +83,7 @@ static int sftpResumeUpload(CURL *curlhandle, const char *remotepath,
CURLcode result = CURLE_GOT_NOTHING;
curl_off_t remoteFileSizeByte = sftpGetRemoteFileSize(remotepath);
if(-1 == remoteFileSizeByte) {
if(remoteFileSizeByte == -1) {
printf("Error reading the remote file size: unable to resume upload\n");
return -1;
}

View file

@ -130,7 +130,7 @@ void *create_thread(void *progress_bar)
NULL, /* default attributes please */
pull_one_url,
NULL);
if(0 != error)
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);

View file

@ -83,7 +83,7 @@ int main(int argc, char **argv)
NULL, /* default attributes please */
pull_one_url,
(void *)urls[i]);
if(0 != error)
if(error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);