From 786246efd8eb2116e1c36151018feec2b55ef73a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Oct 2013 01:03:44 +0300 Subject: fix code style in download.cpp --- src/net/download.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net/download.cpp b/src/net/download.cpp index fad1ec0b4..3f26aabe7 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -173,7 +173,7 @@ bool Download::start() { logger->log("Starting download: %s", mUrl.c_str()); - mThread = SDL::createThread(downloadThread, "download", this); + mThread = SDL::createThread(&downloadThread, "download", this); if (!mThread) { logger->log1(DOWNLOAD_ERROR_MESSAGE_THREAD); @@ -266,7 +266,8 @@ int Download::downloadThread(void *ptr) else { file = fopen(outFilename.c_str(), "w+b"); - curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file); + if (file) + curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file); } curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, @@ -276,7 +277,7 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0); curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSFUNCTION, - downloadProgress); + &downloadProgress); curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSDATA, ptr); curl_easy_setopt(d->mCurl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30); -- cgit v1.2.3-70-g09d2