From: Viktor Szakats Date: Sat, 7 Feb 2026 15:50:54 +0000 (+0100) Subject: docs: compare `result` against literal `CURLE_OK` (where missing) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02c37d269c94679915ca9233e49c5fe520c3a359;p=thirdparty%2Fcurl.git docs: compare `result` against literal `CURLE_OK` (where missing) Also scope to result variables. Closes #20536 --- diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c index 6bc2bd71df..f04702f59b 100644 --- a/docs/examples/10-at-a-time.c +++ b/docs/examples/10-at-a-time.c @@ -107,7 +107,7 @@ int main(void) CURLM *multi; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; multi = curl_multi_init(); diff --git a/docs/examples/address-scope.c b/docs/examples/address-scope.c index dba6c8f773..0cb9e0158d 100644 --- a/docs/examples/address-scope.c +++ b/docs/examples/address-scope.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/altsvc.c b/docs/examples/altsvc.c index bb813aa3f7..35fbc39a1a 100644 --- a/docs/examples/altsvc.c +++ b/docs/examples/altsvc.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index a44194aaa5..9b08bbe41b 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -116,7 +116,7 @@ int main(int argc, const char **argv) /* In Windows, this inits the Winsock stuff */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fclose(fp); return (int)result; } diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index 6bf0625fdd..70a7b99f58 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -296,7 +296,7 @@ int main(void) return 1; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { free(filter); return (int)result; } diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c index 2ede090a26..cd5013c30d 100644 --- a/docs/examples/cacertinmem.c +++ b/docs/examples/cacertinmem.c @@ -119,7 +119,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c index 7dfa8e99c9..f9623281bb 100644 --- a/docs/examples/certinfo.c +++ b/docs/examples/certinfo.c @@ -42,7 +42,7 @@ int main(void) CURLcode result; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); @@ -59,7 +59,7 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { struct curl_certinfo *certinfo; result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &certinfo); diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index a0c6fe1d3e..b29f803bbd 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -162,7 +162,7 @@ int main(int argc, const char *argv[]) /* init libcurl */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* init the curl session */ diff --git a/docs/examples/connect-to.c b/docs/examples/connect-to.c index d401fca662..706e9882a0 100644 --- a/docs/examples/connect-to.c +++ b/docs/examples/connect-to.c @@ -35,7 +35,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c index e894f19665..aa3ea1d013 100644 --- a/docs/examples/cookie_interface.c +++ b/docs/examples/cookie_interface.c @@ -77,7 +77,7 @@ int main(void) CURLcode result; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/crawler.c b/docs/examples/crawler.c index 2b199be116..915a7cae47 100644 --- a/docs/examples/crawler.c +++ b/docs/examples/crawler.c @@ -186,7 +186,7 @@ int main(void) CURLcode result; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; signal(SIGINT, sighandler); diff --git a/docs/examples/debug.c b/docs/examples/debug.c index 98457d53b2..44156cd823 100644 --- a/docs/examples/debug.c +++ b/docs/examples/debug.c @@ -125,7 +125,7 @@ int main(void) struct data config; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; config.trace_ascii = 1; /* enable ASCII tracing */ diff --git a/docs/examples/default-scheme.c b/docs/examples/default-scheme.c index 821cad78c2..198c9c8041 100644 --- a/docs/examples/default-scheme.c +++ b/docs/examples/default-scheme.c @@ -35,7 +35,7 @@ int main(void) CURLcode result; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c index 5f9362b83e..1b5095a467 100644 --- a/docs/examples/ephiperfifo.c +++ b/docs/examples/ephiperfifo.c @@ -464,7 +464,7 @@ int main(void) struct epoll_event events[10]; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; g_should_exit_ = 0; diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 565293d140..9799e5c067 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -413,7 +413,7 @@ int main(void) struct GlobalInfo g; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; memset(&g, 0, sizeof(g)); diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index d1bdd732b9..959fbf7f11 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -104,7 +104,7 @@ int main(void) curl_socket_t sockfd; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); @@ -163,7 +163,7 @@ int main(void) close(sockfd); - if(result) { + if(result != CURLE_OK) { printf("libcurl error: %d\n", result); return 4; } diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index 82ebd878c7..f444da9b9e 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -54,7 +54,7 @@ int main(void) FILE *fd; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; fd = fopen("debugit", "rb"); /* open file to upload */ diff --git a/docs/examples/ftp-delete.c b/docs/examples/ftp-delete.c index 9041baa380..5cc953e02d 100644 --- a/docs/examples/ftp-delete.c +++ b/docs/examples/ftp-delete.c @@ -43,7 +43,7 @@ int main(void) struct curl_slist *headerlist = NULL; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index e8f0be6263..abde048e9d 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -107,7 +107,7 @@ int main(int argc, const char **argv) /* global initialization */ CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* initialization of easy handle */ diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c index 15a7e22633..28b7a273c3 100644 --- a/docs/examples/ftpget.c +++ b/docs/examples/ftpget.c @@ -62,7 +62,7 @@ int main(void) }; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c index fd3fb90f57..ff2a8da084 100644 --- a/docs/examples/ftpgetinfo.c +++ b/docs/examples/ftpgetinfo.c @@ -56,7 +56,7 @@ int main(void) const char *filename = strrchr(ftpurl, '/') + 1; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index c05f989f9a..8f888b470e 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -53,7 +53,7 @@ int main(void) FILE *respfile; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* local filename to store the file as */ diff --git a/docs/examples/ftpsget.c b/docs/examples/ftpsget.c index 142d1fbcb7..b899d4caf5 100644 --- a/docs/examples/ftpsget.c +++ b/docs/examples/ftpsget.c @@ -62,7 +62,7 @@ int main(void) }; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 85b68da1bf..5b6ed7893e 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -107,7 +107,7 @@ int main(void) /* In Windows, this inits the Winsock stuff */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fclose(hd_src); return (int)result; } diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index 4908505ea1..c990622529 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -158,7 +158,7 @@ int main(void) CURL *curl = NULL; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/getinfo.c b/docs/examples/getinfo.c index 811b0307c3..43a4eeb524 100644 --- a/docs/examples/getinfo.c +++ b/docs/examples/getinfo.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index ea4da5dd9d..1743b203f5 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -65,7 +65,7 @@ int main(void) struct MemoryStruct chunk; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; chunk.memory = malloc(1); /* grown as needed by the realloc above */ diff --git a/docs/examples/getredirect.c b/docs/examples/getredirect.c index 27c20ddb73..e144e628e4 100644 --- a/docs/examples/getredirect.c +++ b/docs/examples/getredirect.c @@ -35,7 +35,7 @@ int main(void) CURLcode result; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/getreferrer.c b/docs/examples/getreferrer.c index cbe031763f..b2220842ec 100644 --- a/docs/examples/getreferrer.c +++ b/docs/examples/getreferrer.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index 522f69a054..7d79a973aa 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -432,7 +432,7 @@ int main(void) GIOChannel *ch; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; fd = init_fifo(); diff --git a/docs/examples/headerapi.c b/docs/examples/headerapi.c index cbc60acc94..61f2eb98e8 100644 --- a/docs/examples/headerapi.c +++ b/docs/examples/headerapi.c @@ -42,7 +42,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index dccd4f6274..109addef76 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -422,7 +422,7 @@ int main(void) struct GlobalInfo g; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; memset(&g, 0, sizeof(g)); diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index 8e73b79cda..877e8eb73e 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -92,7 +92,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index 7c11afbb2a..c73e5385e9 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -89,7 +89,7 @@ int main(int argc, const char **argv) } result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; tdoc = tidyCreate(); @@ -108,7 +108,7 @@ int main(int argc, const char **argv) curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf); result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { result = tidyParseBuffer(tdoc, &docbuf); /* parse the input */ if(result >= 0) { result = tidyCleanAndRepair(tdoc); /* fix any problems */ diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index ea62f93290..7986b94640 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -264,7 +264,7 @@ int main(int argc, const char *argv[]) } result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; // Initialize CURL handle diff --git a/docs/examples/http-options.c b/docs/examples/http-options.c index 105f996436..16338441c7 100644 --- a/docs/examples/http-options.c +++ b/docs/examples/http-options.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/http-post.c b/docs/examples/http-post.c index dac8953b72..8f8be06748 100644 --- a/docs/examples/http-post.c +++ b/docs/examples/http-post.c @@ -36,7 +36,7 @@ int main(void) /* In Windows, this inits the Winsock stuff */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* get a curl handle */ diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 3e5dde1d2c..80c3365bb2 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -206,7 +206,7 @@ int main(int argc, const char **argv) num_transfers = 3; /* a suitable low default */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; trans = calloc(num_transfers, sizeof(*trans)); diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index a51232e359..e99fe746d0 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -126,7 +126,7 @@ int main(void) int i; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* init a multi stack */ diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index afeec76949..e54675ceac 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -226,7 +226,7 @@ int main(int argc, const char *argv[]) url = argv[1]; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* init a multi stack */ diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index b2657940e5..d044aa8ac0 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -309,7 +309,7 @@ int main(int argc, const char **argv) num_transfers = 3; /* a suitable low default */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; trans = calloc(num_transfers, sizeof(*trans)); diff --git a/docs/examples/http3-present.c b/docs/examples/http3-present.c index ee9bdce2d9..5de7d870f4 100644 --- a/docs/examples/http3-present.c +++ b/docs/examples/http3-present.c @@ -34,7 +34,7 @@ int main(void) curl_version_info_data *ver; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; ver = curl_version_info(CURLVERSION_NOW); diff --git a/docs/examples/http3.c b/docs/examples/http3.c index 702c7d9ac3..7b52e43a9a 100644 --- a/docs/examples/http3.c +++ b/docs/examples/http3.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/httpcustomheader.c b/docs/examples/httpcustomheader.c index 7888dfab38..1d500b2352 100644 --- a/docs/examples/httpcustomheader.c +++ b/docs/examples/httpcustomheader.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/httpput-postfields.c b/docs/examples/httpput-postfields.c index 88eb55f06e..8a30ac67db 100644 --- a/docs/examples/httpput-postfields.c +++ b/docs/examples/httpput-postfields.c @@ -60,7 +60,7 @@ int main(int argc, const char **argv) /* In Windows, this inits the Winsock stuff */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* get a curl handle */ diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 9fd808814f..58be20151e 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -104,7 +104,7 @@ int main(int argc, const char **argv) /* In Windows, this inits the Winsock stuff */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fclose(hd_src); return (int)result; } diff --git a/docs/examples/https.c b/docs/examples/https.c index 7bb11d21e0..5fefb5eea3 100644 --- a/docs/examples/https.c +++ b/docs/examples/https.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c index 7bd75edd93..8d7663a611 100644 --- a/docs/examples/imap-append.c +++ b/docs/examples/imap-append.c @@ -88,7 +88,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-authzid.c b/docs/examples/imap-authzid.c index bf9a61f6af..0130d4cf19 100644 --- a/docs/examples/imap-authzid.c +++ b/docs/examples/imap-authzid.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-copy.c b/docs/examples/imap-copy.c index 91d95b12a6..e19d4b480d 100644 --- a/docs/examples/imap-copy.c +++ b/docs/examples/imap-copy.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-create.c b/docs/examples/imap-create.c index 259dc2232f..f1eadb5860 100644 --- a/docs/examples/imap-create.c +++ b/docs/examples/imap-create.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-delete.c b/docs/examples/imap-delete.c index 03e9d2ad7d..9d33f6fa6b 100644 --- a/docs/examples/imap-delete.c +++ b/docs/examples/imap-delete.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-examine.c b/docs/examples/imap-examine.c index fcb960ce50..083708b6c8 100644 --- a/docs/examples/imap-examine.c +++ b/docs/examples/imap-examine.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-fetch.c b/docs/examples/imap-fetch.c index b067d15385..c3d6af75c2 100644 --- a/docs/examples/imap-fetch.c +++ b/docs/examples/imap-fetch.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-list.c b/docs/examples/imap-list.c index 263219eded..1c1074f85b 100644 --- a/docs/examples/imap-list.c +++ b/docs/examples/imap-list.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-lsub.c b/docs/examples/imap-lsub.c index 75dbd3ceae..7ffeba04f7 100644 --- a/docs/examples/imap-lsub.c +++ b/docs/examples/imap-lsub.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-multi.c b/docs/examples/imap-multi.c index 35aff98ad9..192ba15cfd 100644 --- a/docs/examples/imap-multi.c +++ b/docs/examples/imap-multi.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-noop.c b/docs/examples/imap-noop.c index 9407242918..5b53c03d48 100644 --- a/docs/examples/imap-noop.c +++ b/docs/examples/imap-noop.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-search.c b/docs/examples/imap-search.c index c548829cb5..f06f6a551d 100644 --- a/docs/examples/imap-search.c +++ b/docs/examples/imap-search.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-ssl.c b/docs/examples/imap-ssl.c index 0ec84d7472..77a0880a32 100644 --- a/docs/examples/imap-ssl.c +++ b/docs/examples/imap-ssl.c @@ -41,7 +41,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-store.c b/docs/examples/imap-store.c index db0310b6b0..c1e9de9a91 100644 --- a/docs/examples/imap-store.c +++ b/docs/examples/imap-store.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/imap-tls.c b/docs/examples/imap-tls.c index 6c09380221..486bc8c467 100644 --- a/docs/examples/imap-tls.c +++ b/docs/examples/imap-tls.c @@ -41,7 +41,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/interface.c b/docs/examples/interface.c index cfe3180f56..870f94057a 100644 --- a/docs/examples/interface.c +++ b/docs/examples/interface.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/ipv6.c b/docs/examples/ipv6.c index 03e2a0726c..607d9d4096 100644 --- a/docs/examples/ipv6.c +++ b/docs/examples/ipv6.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/keepalive.c b/docs/examples/keepalive.c index 7427673394..f6aa692897 100644 --- a/docs/examples/keepalive.c +++ b/docs/examples/keepalive.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/localport.c b/docs/examples/localport.c index 6cb863cd8d..1027c4387f 100644 --- a/docs/examples/localport.c +++ b/docs/examples/localport.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index 3f651c059b..3d9bfb0ad8 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -225,7 +225,7 @@ int main(void) transfer[1].logfile = "400_transfer_log.txt"; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fprintf(stderr, "curl_global_init failed\n"); return (int)result; } diff --git a/docs/examples/maxconnects.c b/docs/examples/maxconnects.c index 0efcaeac1c..3c6f3c8b3d 100644 --- a/docs/examples/maxconnects.c +++ b/docs/examples/maxconnects.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 44aec5bb21..4a1f3b1f97 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -47,7 +47,7 @@ int main(void) int i; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* Allocate one curl handle per transfer */ diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index 05e51f9a4f..af1713c260 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -118,7 +118,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/multi-double.c b/docs/examples/multi-double.c index 04ea342ed8..709b949903 100644 --- a/docs/examples/multi-double.c +++ b/docs/examples/multi-double.c @@ -39,7 +39,7 @@ int main(void) CURL *curl2; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/multi-event.c b/docs/examples/multi-event.c index b748238904..4c52cbe3b3 100644 --- a/docs/examples/multi-event.c +++ b/docs/examples/multi-event.c @@ -221,7 +221,7 @@ int main(int argc, const char **argv) return 0; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fprintf(stderr, "Could not init curl\n"); return (int)result; } diff --git a/docs/examples/multi-formadd.c b/docs/examples/multi-formadd.c index 6611f2f12e..8816d69171 100644 --- a/docs/examples/multi-formadd.c +++ b/docs/examples/multi-formadd.c @@ -44,7 +44,7 @@ int main(void) static const char buf[] = "Expect:"; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; CURL_IGNORE_DEPRECATION( diff --git a/docs/examples/multi-legacy.c b/docs/examples/multi-legacy.c index 1c14ea0bd0..a0580c6712 100644 --- a/docs/examples/multi-legacy.c +++ b/docs/examples/multi-legacy.c @@ -53,7 +53,7 @@ int main(void) int i; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* Allocate one curl handle per transfer */ diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index 48db32ff39..b5d557ce8a 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index 0cf18891fd..5f0380a6f4 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -39,7 +39,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 6928408461..8d6227fc7e 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -237,7 +237,7 @@ int main(int argc, const char **argv) return 0; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; uv.loop = uv_default_loop(); diff --git a/docs/examples/netrc.c b/docs/examples/netrc.c index 8bc998ae43..d862210445 100644 --- a/docs/examples/netrc.c +++ b/docs/examples/netrc.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/persistent.c b/docs/examples/persistent.c index 50d110f3e0..852f923dd1 100644 --- a/docs/examples/persistent.c +++ b/docs/examples/persistent.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-authzid.c b/docs/examples/pop3-authzid.c index ed7993d85f..3f40e78c71 100644 --- a/docs/examples/pop3-authzid.c +++ b/docs/examples/pop3-authzid.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-dele.c b/docs/examples/pop3-dele.c index f872b882e4..69ee1de992 100644 --- a/docs/examples/pop3-dele.c +++ b/docs/examples/pop3-dele.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-list.c b/docs/examples/pop3-list.c index 7cc9a249d5..9a2693d3b1 100644 --- a/docs/examples/pop3-list.c +++ b/docs/examples/pop3-list.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-multi.c b/docs/examples/pop3-multi.c index 741b7f8d2d..4e69172e4b 100644 --- a/docs/examples/pop3-multi.c +++ b/docs/examples/pop3-multi.c @@ -41,7 +41,7 @@ int main(void) CURL *curl; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-noop.c b/docs/examples/pop3-noop.c index 5e05713ec6..4b1b050182 100644 --- a/docs/examples/pop3-noop.c +++ b/docs/examples/pop3-noop.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-retr.c b/docs/examples/pop3-retr.c index af7e40293a..c0c9e92791 100644 --- a/docs/examples/pop3-retr.c +++ b/docs/examples/pop3-retr.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-ssl.c b/docs/examples/pop3-ssl.c index c38d41152a..221a0ab703 100644 --- a/docs/examples/pop3-ssl.c +++ b/docs/examples/pop3-ssl.c @@ -41,7 +41,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-stat.c b/docs/examples/pop3-stat.c index 160f013d2d..4f16546c2b 100644 --- a/docs/examples/pop3-stat.c +++ b/docs/examples/pop3-stat.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-tls.c b/docs/examples/pop3-tls.c index 4258088722..ce38d044f0 100644 --- a/docs/examples/pop3-tls.c +++ b/docs/examples/pop3-tls.c @@ -41,7 +41,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-top.c b/docs/examples/pop3-top.c index b961487685..177417fde6 100644 --- a/docs/examples/pop3-top.c +++ b/docs/examples/pop3-top.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/pop3-uidl.c b/docs/examples/pop3-uidl.c index 4cf571621a..98f4a3f14a 100644 --- a/docs/examples/pop3-uidl.c +++ b/docs/examples/pop3-uidl.c @@ -40,7 +40,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index f310c14489..5b3251f506 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -64,7 +64,7 @@ int main(void) static const char *postthis = "Field=1&Field=2&Field=3"; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; chunk.memory = malloc(1); /* grown as needed by realloc above */ diff --git a/docs/examples/postit2-formadd.c b/docs/examples/postit2-formadd.c index 3c297478ff..c760bcb0da 100644 --- a/docs/examples/postit2-formadd.c +++ b/docs/examples/postit2-formadd.c @@ -56,7 +56,7 @@ int main(int argc, const char *argv[]) static const char buf[] = "Expect:"; result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; CURL_IGNORE_DEPRECATION( diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 5632717cd4..0bc1e6a48f 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -47,7 +47,7 @@ int main(int argc, const char *argv[]) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c index 22f876b5c8..4138a6b63f 100644 --- a/docs/examples/progressfunc.c +++ b/docs/examples/progressfunc.c @@ -78,7 +78,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/protofeats.c b/docs/examples/protofeats.c index e8d8540089..73cbf1c221 100644 --- a/docs/examples/protofeats.c +++ b/docs/examples/protofeats.c @@ -39,7 +39,7 @@ int main(void) const char * const *ptr; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; ver = curl_version_info(CURLVERSION_NOW); diff --git a/docs/examples/range.c b/docs/examples/range.c index 9555725dab..857ee92600 100644 --- a/docs/examples/range.c +++ b/docs/examples/range.c @@ -32,7 +32,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c index e56c8efb87..9c87bc0086 100644 --- a/docs/examples/resolve.c +++ b/docs/examples/resolve.c @@ -43,7 +43,7 @@ int main(void) "example.com:443:127.0.0.1"); CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/rtsp-options.c b/docs/examples/rtsp-options.c index 7c7ff945f9..c7800460b4 100644 --- a/docs/examples/rtsp-options.c +++ b/docs/examples/rtsp-options.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/sendrecv.c b/docs/examples/sendrecv.c index deadefa21e..964fc6e0b8 100644 --- a/docs/examples/sendrecv.c +++ b/docs/examples/sendrecv.c @@ -81,7 +81,7 @@ int main(void) size_t request_len = strlen(request); CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* A general note of caution here: if you are using curl_easy_recv() or diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index 134ecb94a4..e300205223 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -47,7 +47,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* init the curl session */ diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index 788ccf575b..3872180b77 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -53,7 +53,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) result = curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &info); - if(!result) { + if(result == CURLE_OK) { unsigned int cert_list_size; const gnutls_datum_t *chainp; @@ -97,7 +97,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) int main(void) { CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/sftpget.c b/docs/examples/sftpget.c index df9b4d7f31..02f2070882 100644 --- a/docs/examples/sftpget.c +++ b/docs/examples/sftpget.c @@ -71,7 +71,7 @@ int main(void) }; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index e774820b09..153883640b 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -73,7 +73,7 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) if(result == CURLE_OK) { result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &remoteFileSizeByte); - if(result) + if(result != CURLE_OK) return -1; printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); } @@ -129,7 +129,7 @@ int main(void) CURL *curl = NULL; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index 475bb182a8..00ebc3b759 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -53,7 +53,7 @@ int main(void) int i; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; share = curl_share_init(); diff --git a/docs/examples/simple.c b/docs/examples/simple.c index 6f0751775f..b7b48d7777 100644 --- a/docs/examples/simple.c +++ b/docs/examples/simple.c @@ -34,7 +34,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c index 7b9356acf9..d2540151ce 100644 --- a/docs/examples/simplepost.c +++ b/docs/examples/simplepost.c @@ -37,7 +37,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index 9885dfd91d..f1c07a4ae2 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -71,7 +71,7 @@ int main(void) #endif result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { return (int)result; } diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 64595f3955..694426f911 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -172,7 +172,7 @@ int main(int argc, const char **argv) /* Must initialize libcurl before any threads are started */ CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* Init thread */ diff --git a/docs/examples/smtp-authzid.c b/docs/examples/smtp-authzid.c index 64540cb033..e06946869f 100644 --- a/docs/examples/smtp-authzid.c +++ b/docs/examples/smtp-authzid.c @@ -93,7 +93,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-expn.c b/docs/examples/smtp-expn.c index 9b201240dc..42a7480625 100644 --- a/docs/examples/smtp-expn.c +++ b/docs/examples/smtp-expn.c @@ -43,7 +43,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c index 0a3e73d39f..d4a73e0690 100644 --- a/docs/examples/smtp-mail.c +++ b/docs/examples/smtp-mail.c @@ -90,7 +90,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-mime.c b/docs/examples/smtp-mime.c index 7aa610789a..0ddba4ebb7 100644 --- a/docs/examples/smtp-mime.c +++ b/docs/examples/smtp-mime.c @@ -71,7 +71,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index 0ce6911152..2cfdbb5793 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -83,7 +83,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c index acc559562f..73c8b6a708 100644 --- a/docs/examples/smtp-ssl.c +++ b/docs/examples/smtp-ssl.c @@ -87,7 +87,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index 3b622859ca..f5cafaeb81 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -87,7 +87,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/smtp-vrfy.c b/docs/examples/smtp-vrfy.c index 4d5a8ad601..b60dfef25e 100644 --- a/docs/examples/smtp-vrfy.c +++ b/docs/examples/smtp-vrfy.c @@ -46,7 +46,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index e9b730d50a..730e01641f 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -275,7 +275,7 @@ int main(int argc, const char *argv[]) /* Init CURL before usage */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/threaded.c b/docs/examples/threaded.c index 9eeffa78f6..a8788b7eec 100644 --- a/docs/examples/threaded.c +++ b/docs/examples/threaded.c @@ -88,7 +88,7 @@ int main(void) /* Must initialize libcurl before any threads are started */ result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; for(i = 0; i < NUMT; i++) { diff --git a/docs/examples/unixsocket.c b/docs/examples/unixsocket.c index 4a1a2937d6..01810fd624 100644 --- a/docs/examples/unixsocket.c +++ b/docs/examples/unixsocket.c @@ -43,7 +43,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index 3370ac2f79..9ff0dd4fca 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -55,7 +55,7 @@ int main(int argc, const char *argv[]) } result = curl_global_init(CURL_GLOBAL_ALL); - if(result) { + if(result != CURLE_OK) { fprintf(stderr, "Could not init curl\n"); return (int)result; } diff --git a/docs/examples/urlapi.c b/docs/examples/urlapi.c index 4d6c6444bd..50175da76e 100644 --- a/docs/examples/urlapi.c +++ b/docs/examples/urlapi.c @@ -39,7 +39,7 @@ int main(void) CURLUcode uc; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* init curl URL */ diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 6c782647c7..7caa4be626 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -159,7 +159,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/websocket-cb.c b/docs/examples/websocket-cb.c index defde4c0fe..e73cc27a3f 100644 --- a/docs/examples/websocket-cb.c +++ b/docs/examples/websocket-cb.c @@ -46,7 +46,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/websocket-updown.c b/docs/examples/websocket-updown.c index 8cbb938e9d..3a7f07767f 100644 --- a/docs/examples/websocket-updown.c +++ b/docs/examples/websocket-updown.c @@ -60,14 +60,14 @@ static size_t read_cb(char *buf, size_t nitems, size_t buflen, void *p) struct read_ctx *ctx = p; size_t len = nitems * buflen; size_t left = ctx->blen - ctx->nsent; - CURLcode result; if(!ctx->nsent) { + CURLcode result; /* On first call, set the FRAME information to be used (it defaults to * CURLWS_BINARY otherwise). */ result = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, (curl_off_t)ctx->blen); - if(result) { + if(result != CURLE_OK) { fprintf(stderr, "error starting frame: %d\n", result); return CURL_READFUNC_ABORT; } @@ -90,7 +90,7 @@ int main(int argc, const char *argv[]) const char *payload = "Hello, friend!"; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; memset(&rctx, 0, sizeof(rctx)); diff --git a/docs/examples/websocket.c b/docs/examples/websocket.c index 2fa53028a8..834cab0c4c 100644 --- a/docs/examples/websocket.c +++ b/docs/examples/websocket.c @@ -45,7 +45,7 @@ static CURLcode ping(CURL *curl, const char *send_payload) while(blen) { result = curl_ws_send(curl, buf, blen, &sent, 0, CURLWS_PING); - if(!result) { + if(result == CURLE_OK) { buf += sent; /* deduct what was sent */ blen -= sent; } @@ -57,7 +57,7 @@ static CURLcode ping(CURL *curl, const char *send_payload) else /* real error sending */ break; } - if(!result) + if(result == CURLE_OK) fprintf(stderr, "ws: sent PING with payload\n"); return result; } @@ -71,7 +71,7 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) retry: result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); - if(!result) { + if(result == CURLE_OK) { /* on small PING content, this example assumes the complete * PONG content arrives in one go. Larger frames will arrive * in chunks, however. */ @@ -104,7 +104,7 @@ retry: be good here. */ goto retry; } - if(result) + if(result != CURLE_OK) fprintf(stderr, "ws: curl_ws_recv returned %u, received %u\n", (unsigned int)result, (unsigned int)rlen); return result; @@ -123,10 +123,10 @@ static CURLcode websocket(CURL *curl) int i = 0; do { result = ping(curl, "foobar"); - if(result) + if(result != CURLE_OK) break; result = recv_pong(curl, "foobar"); - if(result) + if(result != CURLE_OK) break; sleep(1); } while(i++ < 10); @@ -139,7 +139,7 @@ int main(int argc, const char *argv[]) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; curl = curl_easy_init(); diff --git a/docs/examples/xmlstream.c b/docs/examples/xmlstream.c index 9122c491dc..2ad132f282 100644 --- a/docs/examples/xmlstream.c +++ b/docs/examples/xmlstream.c @@ -119,7 +119,7 @@ int main(void) CURL *curl; CURLcode result = curl_global_init(CURL_GLOBAL_ALL); - if(result) + if(result != CURLE_OK) return (int)result; /* Initialize a libcurl handle. */ diff --git a/docs/libcurl/curl_easy_cleanup.md b/docs/libcurl/curl_easy_cleanup.md index ee722ca84d..bf9b18b363 100644 --- a/docs/libcurl/curl_easy_cleanup.md +++ b/docs/libcurl/curl_easy_cleanup.md @@ -65,7 +65,7 @@ int main(void) CURLcode result; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); result = curl_easy_perform(curl); - if(result) + if(result != CURLE_OK) printf("error: %s\n", curl_easy_strerror(result)); curl_easy_cleanup(curl); } diff --git a/docs/libcurl/curl_ws_start_frame.md b/docs/libcurl/curl_ws_start_frame.md index 84b8065d93..3fea3604b1 100644 --- a/docs/libcurl/curl_ws_start_frame.md +++ b/docs/libcurl/curl_ws_start_frame.md @@ -77,13 +77,13 @@ static size_t readcb(char *buf, size_t nitems, size_t buflen, void *p) struct read_ctx *ctx = p; size_t len = nitems * buflen; size_t left = ctx->msg_len - ctx->nsent; - CURLcode result; if(!ctx->nsent) { + CURLcode result; /* Want to send TEXT frame. */ result = curl_ws_start_frame(ctx->easy, CURLWS_TEXT, (curl_off_t)ctx->msg_len); - if(result) { + if(result != CURLE_OK) { fprintf(stderr, "error starting frame: %d\n", result); return CURL_READFUNC_ABORT; } diff --git a/docs/libcurl/opts/CURLINFO_CERTINFO.md b/docs/libcurl/opts/CURLINFO_CERTINFO.md index e24115f98f..0882cbccd1 100644 --- a/docs/libcurl/opts/CURLINFO_CERTINFO.md +++ b/docs/libcurl/opts/CURLINFO_CERTINFO.md @@ -71,12 +71,12 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { int i; struct curl_certinfo *ci; result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci); - if(!result) { + if(result == CURLE_OK) { printf("%d certs!\n", ci->num_of_certs); for(i = 0; i < ci->num_of_certs; i++) { diff --git a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md index 1705967dfe..8e44e7bd94 100644 --- a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md +++ b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md @@ -59,11 +59,11 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the time condition */ long unmet; result = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet); - if(!result) { + if(result == CURLE_OK) { printf("The time condition was %sfulfilled\n", unmet?"NOT":""); } } diff --git a/docs/libcurl/opts/CURLINFO_CONN_ID.md b/docs/libcurl/opts/CURLINFO_CONN_ID.md index 75e2ccc5eb..3d111e6b62 100644 --- a/docs/libcurl/opts/CURLINFO_CONN_ID.md +++ b/docs/libcurl/opts/CURLINFO_CONN_ID.md @@ -51,10 +51,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t conn_id; result = curl_easy_getinfo(curl, CURLINFO_CONN_ID, &conn_id); - if(!result) { + if(result == CURLE_OK) { printf("Connection used: %" CURL_FORMAT_CURL_OFF_T "\n", conn_id); } } diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md index 1142617c19..7173f8effb 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md @@ -50,11 +50,11 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ double cl; result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl); - if(!result) { + if(result == CURLE_OK) { printf("Size: %.0f\n", cl); } } diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md index 4f8faf6e99..d0a95f6144 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md @@ -47,12 +47,12 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ curl_off_t cl; result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cl); - if(!result) { + if(result == CURLE_OK) { printf("Download size: %" CURL_FORMAT_CURL_OFF_T "\n", cl); } } diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md index 546325f179..6ccd47f1ad 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md @@ -49,11 +49,11 @@ int main(void) /* Perform the upload */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ double cl; result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &cl); - if(!result) { + if(result == CURLE_OK) { printf("Size: %.0f\n", cl); } } diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md index 6ad40241fe..219481f43d 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md @@ -46,11 +46,11 @@ int main(void) /* Perform the upload */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ curl_off_t cl; result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD_T, &cl); - if(!result) { + if(result == CURLE_OK) { printf("Upload size: %" CURL_FORMAT_CURL_OFF_T "\n", cl); } } diff --git a/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md b/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md index 8de0a65461..13feaca953 100644 --- a/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md +++ b/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md @@ -54,7 +54,7 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract the content-type */ char *ct = NULL; result = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct); diff --git a/docs/libcurl/opts/CURLINFO_COOKIELIST.md b/docs/libcurl/opts/CURLINFO_COOKIELIST.md index 7d0925500d..04a618e860 100644 --- a/docs/libcurl/opts/CURLINFO_COOKIELIST.md +++ b/docs/libcurl/opts/CURLINFO_COOKIELIST.md @@ -54,7 +54,7 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract all known cookies */ struct curl_slist *cookies = NULL; result = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies); diff --git a/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md b/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md index c2cb4a558e..c326c31f45 100644 --- a/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md +++ b/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md @@ -57,10 +57,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t amount; result = curl_easy_getinfo(curl, CURLINFO_EARLYDATA_SENT_T, &amount); - if(!result) { + if(result == CURLE_OK) { printf("TLS earlydata: %" CURL_FORMAT_CURL_OFF_T " bytes\n", amount); } } diff --git a/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md b/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md index 058d273ba0..4efccececc 100644 --- a/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md +++ b/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md @@ -50,7 +50,7 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract the entry path */ char *ep = NULL; result = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep); diff --git a/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md b/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md index a537f0408e..c27856809e 100644 --- a/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md +++ b/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md @@ -49,7 +49,7 @@ int main(void) if(result == CURLE_OK) { long size; result = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size); - if(!result) + if(result == CURLE_OK) printf("Header size: %ld bytes\n", size); } curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md b/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md index 8829227c98..4ff3578735 100644 --- a/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md +++ b/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md @@ -46,11 +46,11 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract the available authentication types */ long auth; result = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_AVAIL, &auth); - if(!result) { + if(result == CURLE_OK) { if(!auth) printf("No auth available, perhaps no 401?\n"); else { diff --git a/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md b/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md index 031691402b..99db88d3f3 100644 --- a/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md +++ b/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md @@ -50,10 +50,10 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { long auth; result = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_USED, &auth); - if(!result) { + if(result == CURLE_OK) { if(!auth) printf("No auth used\n"); else { diff --git a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md index dfac440979..efb568ad77 100644 --- a/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md +++ b/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md @@ -49,7 +49,7 @@ int main(void) if(result == CURLE_OK) { long connects; result = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects); - if(!result) + if(result == CURLE_OK) printf("It needed %ld connects\n", connects); } curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md index 58b8c0d1b4..f8a2deee97 100644 --- a/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md +++ b/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md @@ -56,7 +56,7 @@ int main(void) if(result == CURLE_OK) { long port; result = curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &port); - if(!result) + if(result == CURLE_OK) printf("Connected to remote port: %ld\n", port); } curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_PRIVATE.md b/docs/libcurl/opts/CURLINFO_PRIVATE.md index ac4fb82e15..f76b277a70 100644 --- a/docs/libcurl/opts/CURLINFO_PRIVATE.md +++ b/docs/libcurl/opts/CURLINFO_PRIVATE.md @@ -52,7 +52,7 @@ int main(void) /* extract the private pointer again */ result = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer); - if(result) + if(result != CURLE_OK) printf("error: %s\n", curl_easy_strerror(result)); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md b/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md index 16161aabee..e38f2f6245 100644 --- a/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md +++ b/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md @@ -47,11 +47,11 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract the available proxy authentication types */ long auth; result = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_AVAIL, &auth); - if(!result) { + if(result == CURLE_OK) { if(!auth) printf("No proxy auth available, perhaps no 407?\n"); else { diff --git a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md index e0788c63f2..9c2ee5b15f 100644 --- a/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md +++ b/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md @@ -53,10 +53,10 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { long auth; result = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_USED, &auth); - if(!result) { + if(result == CURLE_OK) { if(!auth) printf("No auth used\n"); else { diff --git a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md index 6164eaeafd..f9cef23dac 100644 --- a/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md +++ b/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md @@ -53,7 +53,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); result = curl_easy_perform(curl); - if(result) { + if(result != CURLE_OK) { printf("error: %s\n", curl_easy_strerror(result)); curl_easy_cleanup(curl); return 1; @@ -61,7 +61,7 @@ int main(void) result = curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, &verifyresult); - if(!result) { + if(result == CURLE_OK) { printf("The peer verification said %s\n", (verifyresult ? "bad" : "fine")); } diff --git a/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md b/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md index 9657f3de60..35f8aafd7d 100644 --- a/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md +++ b/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md @@ -47,7 +47,7 @@ int main(void) if(result == CURLE_OK) { long req; result = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req); - if(!result) + if(result == CURLE_OK) printf("Request size: %ld bytes\n", req); } curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md index 1b04c27ea9..85efc6e2ff 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md @@ -53,11 +53,11 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ double dl; result = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dl); - if(!result) { + if(result == CURLE_OK) { printf("Downloaded %.0f bytes\n", dl); } } diff --git a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md index 0393c49949..00a1d83d3d 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md @@ -50,11 +50,11 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* check the size */ curl_off_t dl; result = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dl); - if(!result) { + if(result == CURLE_OK) { printf("Downloaded %" CURL_FORMAT_CURL_OFF_T " bytes\n", dl); } } diff --git a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md index 6111db4a57..4f25a4526a 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md @@ -50,10 +50,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { double ul; result = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &ul); - if(!result) { + if(result == CURLE_OK) { printf("Uploaded %.0f bytes\n", ul); } } diff --git a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md index e75a9809ac..c91e3e7c0d 100644 --- a/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md @@ -47,10 +47,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t ul; result = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &ul); - if(!result) { + if(result == CURLE_OK) { printf("Uploaded %" CURL_FORMAT_CURL_OFF_T " bytes\n", ul); } } diff --git a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md index c37155686a..892f920d3b 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md @@ -50,10 +50,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { double speed; result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed); - if(!result) { + if(result == CURLE_OK) { printf("Download speed %.0f bytes/sec\n", speed); } } diff --git a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md index 3c97fbd5c2..94e5eea305 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md @@ -47,10 +47,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t speed; result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed); - if(!result) { + if(result == CURLE_OK) { printf("Download speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed); } diff --git a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md index 801fe83f04..f2e1223675 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md @@ -48,10 +48,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { double speed; result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed); - if(!result) { + if(result == CURLE_OK) { printf("Upload speed %.0f bytes/sec\n", speed); } } diff --git a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md index 49e126bb45..b5165f4665 100644 --- a/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md +++ b/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md @@ -46,10 +46,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t speed; result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed); - if(!result) { + if(result == CURLE_OK) { printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed); } } diff --git a/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md b/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md index d4e565b692..af1f911a09 100644 --- a/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md +++ b/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md @@ -52,7 +52,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); result = curl_easy_perform(curl); - if(result) { + if(result != CURLE_OK) { printf("error: %s\n", curl_easy_strerror(result)); curl_easy_cleanup(curl); return 1; @@ -60,7 +60,7 @@ int main(void) result = curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &verifyresult); - if(!result) { + if(result == CURLE_OK) { printf("The peer verification said %s\n", (verifyresult ? "bad" : "fine")); } diff --git a/docs/libcurl/opts/CURLINFO_TLS_SESSION.md b/docs/libcurl/opts/CURLINFO_TLS_SESSION.md index f4e24253b7..39f1a43e2f 100644 --- a/docs/libcurl/opts/CURLINFO_TLS_SESSION.md +++ b/docs/libcurl/opts/CURLINFO_TLS_SESSION.md @@ -72,7 +72,7 @@ int main(void) struct curl_tlssessioninfo *tls; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); result = curl_easy_perform(curl); - if(result) + if(result != CURLE_OK) printf("error: %s\n", curl_easy_strerror(result)); curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &tls); curl_easy_cleanup(curl); diff --git a/docs/libcurl/opts/CURLINFO_USED_PROXY.md b/docs/libcurl/opts/CURLINFO_USED_PROXY.md index 11f367ffa4..34abe2d608 100644 --- a/docs/libcurl/opts/CURLINFO_USED_PROXY.md +++ b/docs/libcurl/opts/CURLINFO_USED_PROXY.md @@ -48,11 +48,11 @@ int main(int argc, char *argv[]) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { /* extract the available proxy authentication types */ long used; result = curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &used); - if(!result) { + if(result == CURLE_OK) { printf("The proxy was %sused\n", used ? "" : "NOT "); } } diff --git a/docs/libcurl/opts/CURLINFO_XFER_ID.md b/docs/libcurl/opts/CURLINFO_XFER_ID.md index c01ccd2722..34557b7f29 100644 --- a/docs/libcurl/opts/CURLINFO_XFER_ID.md +++ b/docs/libcurl/opts/CURLINFO_XFER_ID.md @@ -51,10 +51,10 @@ int main(void) /* Perform the request */ result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { curl_off_t xfer_id; result = curl_easy_getinfo(curl, CURLINFO_XFER_ID, &xfer_id); - if(!result) { + if(result == CURLE_OK) { printf("Transfer ID: %" CURL_FORMAT_CURL_OFF_T "\n", xfer_id); } } diff --git a/docs/libcurl/opts/CURLOPT_CERTINFO.md b/docs/libcurl/opts/CURLOPT_CERTINFO.md index e3bf6be8c4..fdaa0d2132 100644 --- a/docs/libcurl/opts/CURLOPT_CERTINFO.md +++ b/docs/libcurl/opts/CURLOPT_CERTINFO.md @@ -64,11 +64,11 @@ int main(void) result = curl_easy_perform(curl); - if(!result) { + if(result == CURLE_OK) { struct curl_certinfo *ci; result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci); - if(!result) { + if(result == CURLE_OK) { int i; printf("%d certs!\n", ci->num_of_certs); diff --git a/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md b/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md index d8fac3b2e2..a2132ee5b3 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md +++ b/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md @@ -104,7 +104,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); result = curl_easy_perform(curl); - if(!result) + if(result == CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); diff --git a/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md b/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md index dff37bb144..827ab0ba1a 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md @@ -157,7 +157,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); result = curl_easy_perform(curl); - if(!result) + if(result == CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n");