#include "curl/curl.h"

struct test_struct {
	char error_buffer[CURL_ERROR_SIZE];
	char sentinel[10];
};

struct test_struct test = {"", "xxxxxx"};
char url[CURL_ERROR_SIZE + 10] = "file:///";

int main(void)
{
	int i;
	CURL *curl;
	for (i = 8; i != CURL_ERROR_SIZE; i++)
		url[i] = 'a';
	url[CURL_ERROR_SIZE] = 0;
	url[CURL_ERROR_SIZE - 13] = 0;

	printf("sentinel before: %x %x %x %x\n",
			test.sentinel[0],
			test.sentinel[1],
			test.sentinel[2],
			test.sentinel[3]);

	curl = curl_easy_init();
	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
	curl_easy_setopt(curl, CURLOPT_URL, url);
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &test.error_buffer);
	curl_easy_perform(curl);

	printf("\n\n");
	printf("sentinel after: %x %x %x %x\n",
			test.sentinel[0],
			test.sentinel[1],
			test.sentinel[2],
			test.sentinel[3]);

	return 0;
}

