aboutsummaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorGuenter Knauf <lists@gknw.net>2012-07-12 15:18:00 +0200
committerGuenter Knauf <lists@gknw.net>2012-07-12 15:18:00 +0200
commit6e3802a2cfde2edaabef902d494dea58d77f6d5b (patch)
treeaf7c56e2b6cc5bed14f8b7eb98b7b5eb3b3b0fe8 /docs/examples
parentdf5a47b8198ad51146390c80162d098a3c9b7ba5 (diff)
Added error checking for curl_global_init().
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/post-callback.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c
index fa0c4b686..f11fb983b 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();