From 7b82b07fba1a339aecbf85256c759682db6379d6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Oct 2014 10:26:40 +0200 Subject: docs: edited lots of libcurl docs for clarity --- docs/libcurl/opts/CURLOPT_ERRORBUFFER.3 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'docs/libcurl/opts/CURLOPT_ERRORBUFFER.3') diff --git a/docs/libcurl/opts/CURLOPT_ERRORBUFFER.3 b/docs/libcurl/opts/CURLOPT_ERRORBUFFER.3 index d74372376..577202cfc 100644 --- a/docs/libcurl/opts/CURLOPT_ERRORBUFFER.3 +++ b/docs/libcurl/opts/CURLOPT_ERRORBUFFER.3 @@ -48,10 +48,25 @@ NULL .SH PROTOCOLS All .SH EXAMPLE -TODO +.nf +curl = curl_easy_init(); +if(curl) { + char error[CURL_ERROR_SIZE] + + curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + + /* provide a buffer to store errors in */ + curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error); + + /* Perform the request */ + curl_easy_perform(curl); +} +.fi .SH AVAILABILITY Always .SH RETURN VALUE Returns CURLE_OK .SH "SEE ALSO" .BR CURLOPT_DEBUGFUNCTION "(3), " CURLOPT_VERBOSE "(3), " +.BR curl_easy_strerror "(3), " curl_multi_strerror "(3), " +.BR curl_share_strerror "(3) " -- cgit v1.2.3