dload: dont forget to initialize open_mode

That's a funny one, building with optimization levels (with both gcc and
clang) caused open_mode to always be set to "ab", which worked.

This was spotted both with clang-analyzer, and by Jakob who reported a
segfault as he was using an un-optimized build.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2011-04-02 15:53:18 +02:00 committed by Dan McGee
parent 0e03c0849d
commit a461837835
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ static int curl_download_internal(const char *url, const char *localpath,
{
int ret = -1;
FILE *localf = NULL;
const char *open_mode, *useragent;
const char *useragent;
const char *open_mode = "wb";
char *destfile, *tempfile;
char hostname[256]; /* RFC1123 states applications should support this length */
struct stat st;