diff options
author | Marian Klymov <nekto1989@gmail.com> | 2018-06-02 23:52:56 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-06-11 11:14:48 +0200 |
commit | c45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch) | |
tree | 20159c553a74ed98c2431fc8f2852067f79ac4e9 /src/tool_formparse.c | |
parent | 38203f1585da53e07e54e37c7d5da4d72f509a2e (diff) | |
download | curl-c45360d4633850839bb9c2d77dbf8a8285e9ad49.tar.gz |
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
Diffstat (limited to 'src/tool_formparse.c')
-rw-r--r-- | src/tool_formparse.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 9fcf014b8..5d1ea9c53 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -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'; |