mirror of
https://github.com/curl/curl.git
synced 2026-07-28 07:43:08 +03:00
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
This commit is contained in:
parent
38203f1585
commit
c45360d463
61 changed files with 213 additions and 273 deletions
|
|
@ -123,13 +123,12 @@ static int read_field_headers(struct OperationConfig *config,
|
|||
{
|
||||
size_t hdrlen = 0;
|
||||
size_t pos = 0;
|
||||
int c;
|
||||
bool incomment = FALSE;
|
||||
int lineno = 1;
|
||||
char hdrbuf[999]; /* Max. header length + 1. */
|
||||
|
||||
for(;;) {
|
||||
c = getc(fp);
|
||||
int c = getc(fp);
|
||||
if(c == EOF || (!pos && !ISSPACE(c))) {
|
||||
/* Strip and flush the current header. */
|
||||
while(hdrlen && ISSPACE(hdrbuf[hdrlen - 1]))
|
||||
|
|
@ -563,7 +562,6 @@ int formparse(struct OperationConfig *config,
|
|||
struct curl_slist *headers = NULL;
|
||||
curl_mimepart *part = NULL;
|
||||
CURLcode res;
|
||||
int sep = '\0';
|
||||
|
||||
/* Allocate the main mime structure if needed. */
|
||||
if(!*mimepost) {
|
||||
|
|
@ -585,6 +583,7 @@ int formparse(struct OperationConfig *config,
|
|||
/* Scan for the end of the name. */
|
||||
contp = strchr(contents, '=');
|
||||
if(contp) {
|
||||
int sep = '\0';
|
||||
if(contp > contents)
|
||||
name = contents;
|
||||
*contp++ = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue