From 5220c1d69240dfab2087990d24229f81db9b4b33 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 4 Jan 2014 18:10:18 +0000 Subject: examples: Standardised username and password settings for all email examples Replaced the use of CURLOPT_USERPWD for the preferred CURLOPT_USERNAME and CURLOPT_PASSWORD options and used the same username and password for all email examples which is the same as that used in the test suite. --- docs/examples/pop3s.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs/examples/pop3s.c') diff --git a/docs/examples/pop3s.c b/docs/examples/pop3s.c index 44d7c80d0..368d61f2b 100644 --- a/docs/examples/pop3s.c +++ b/docs/examples/pop3s.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -30,7 +30,8 @@ int main(void) curl = curl_easy_init(); if(curl) { /* Set username and password */ - curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password"); + curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); + curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will only fetch the message with ID "1" of the given mailbox */ curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/1"); @@ -61,13 +62,15 @@ int main(void) /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); + /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); - /* always cleanup */ + /* Always cleanup */ curl_easy_cleanup(curl); } + return 0; } -- cgit v1.2.3