From: Guenter Knauf Date: Thu, 12 Jul 2012 13:18:00 +0000 (+0200) Subject: Added error checking for curl_global_init(). X-Git-Tag: curl-7_27_0~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e3802a2cfde2edaabef902d494dea58d77f6d5b;p=thirdparty%2Fcurl.git Added error checking for curl_global_init(). --- diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index fa0c4b6869..f11fb983bf 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -61,7 +61,13 @@ int main(void) pooh.sizeleft = strlen(data); /* In windows, this will init the winsock stuff */ - curl_global_init(CURL_GLOBAL_DEFAULT); + res = curl_global_init(CURL_GLOBAL_DEFAULT); + /* Check for errors */ + if(res != CURLE_OK) { + fprintf(stderr, "curl_global_init() failed: %s\n", + curl_easy_strerror(res)); + return 1; + } /* get a curl handle */ curl = curl_easy_init();