fixed compiler warnings issued by:

gcc 4.3
	curl.h gcc type-checking
	glibc with enabled FORTIFY_SOURCE checking
This commit is contained in:
Martin Willi
2008-11-11 18:37:19 +00:00
parent 3d2dbebd70
commit 479f295049
22 changed files with 125 additions and 59 deletions
+1 -1
View File
@@ -860,7 +860,7 @@ load_acerts(void)
}
}
/* restore directory path */
chdir(save_dir);
ignore_result(chdir(save_dir));
}
/*
+1 -1
View File
@@ -295,7 +295,7 @@ load_authcerts(const char *type, const char *path, u_char auth_flags)
}
}
/* restore directory path */
chdir(save_dir);
ignore_result(chdir(save_dir));
}
/*
+1 -1
View File
@@ -373,7 +373,7 @@ load_crls(void)
}
}
/* restore directory path */
chdir(save_dir);
ignore_result(chdir(save_dir));
}
/*
+8 -1
View File
@@ -249,6 +249,7 @@ write_chunk(const char *filename, const char *label, chunk_t ch
{
mode_t oldmask;
FILE *fd;
size_t written;
if (!force)
{
@@ -268,8 +269,14 @@ write_chunk(const char *filename, const char *label, chunk_t ch
if (fd)
{
fwrite(ch.ptr, sizeof(u_char), ch.len, fd);
written = fwrite(ch.ptr, sizeof(u_char), ch.len, fd);
fclose(fd);
if (written != ch.len)
{
plog(" writing to %s file '%s' failed", label, filename);
umask(oldmask);
return FALSE;
}
plog(" written %s file '%s' (%d bytes)", label, filename, (int)ch.len);
umask(oldmask);
return TRUE;
+3 -3
View File
@@ -324,7 +324,7 @@ fetch_curl(char *url, chunk_t *blob)
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buffer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &errorbuffer);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, TRUE);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, FETCH_CMD_TIMEOUT);
@@ -705,9 +705,9 @@ fetch_ocsp_status(ocsp_location_t* location)
curl_easy_setopt(curl, CURLOPT_URL, uri);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buffer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request.ptr);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (void*)request.ptr);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request.len);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &errorbuffer);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, TRUE);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, FETCH_CMD_TIMEOUT);