cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURLOPT_WRITEDATA Bug

From: Foxbax <foxbax_at_gmail.com>
Date: Sun, 14 Jan 2007 17:19:12 +0800

CURL *curl_handle;
FILE *fp;
char *furl = "http://news.sina.com.cn/";
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
if ((fp = fopen("c:\\xxx.rar", "wb")) == NULL)
  return;
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (FILE*)fp);
curl_easy_setopt(curl_handle, CURLOPT_URL, furl);
curl_easy_perform(curl_handle);
curl_easy_cleanup(curl_handle);
fclose(fp);

In debug version,it's work fine,but in release version,the app crash.
Received on 2007-01-14