mirror of
https://github.com/curl/curl.git
synced 2026-07-25 07:27:16 +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
|
|
@ -163,7 +163,6 @@ static CURLcode inflate_stream(struct connectdata *conn,
|
|||
z_stream *z = &zp->z; /* zlib state structure */
|
||||
uInt nread = z->avail_in;
|
||||
Bytef *orig_in = z->next_in;
|
||||
int status; /* zlib status */
|
||||
bool done = FALSE;
|
||||
CURLcode result = CURLE_OK; /* Curl_client_write status */
|
||||
char *decomp; /* Put the decompressed data here. */
|
||||
|
|
@ -184,6 +183,7 @@ static CURLcode inflate_stream(struct connectdata *conn,
|
|||
/* because the buffer size is fixed, iteratively decompress and transfer to
|
||||
the client via downstream_write function. */
|
||||
while(!done) {
|
||||
int status; /* zlib status */
|
||||
done = TRUE;
|
||||
|
||||
/* (re)set buffer for decompressed output for every iteration */
|
||||
|
|
@ -761,7 +761,6 @@ char *Curl_all_content_encodings(void)
|
|||
const content_encoding * const *cep;
|
||||
const content_encoding *ce;
|
||||
char *ace;
|
||||
char *p;
|
||||
|
||||
for(cep = encodings; *cep; cep++) {
|
||||
ce = *cep;
|
||||
|
|
@ -774,7 +773,7 @@ char *Curl_all_content_encodings(void)
|
|||
|
||||
ace = malloc(len);
|
||||
if(ace) {
|
||||
p = ace;
|
||||
char *p = ace;
|
||||
for(cep = encodings; *cep; cep++) {
|
||||
ce = *cep;
|
||||
if(!strcasecompare(ce->name, CONTENT_ENCODING_DEFAULT)) {
|
||||
|
|
@ -921,10 +920,9 @@ void Curl_unencode_cleanup(struct connectdata *conn)
|
|||
static const content_encoding *find_encoding(const char *name, size_t len)
|
||||
{
|
||||
const content_encoding * const *cep;
|
||||
const content_encoding *ce;
|
||||
|
||||
for(cep = encodings; *cep; cep++) {
|
||||
ce = *cep;
|
||||
const content_encoding *ce = *cep;
|
||||
if((strncasecompare(name, ce->name, len) && !ce->name[len]) ||
|
||||
(ce->alias && strncasecompare(name, ce->alias, len) && !ce->alias[len]))
|
||||
return ce;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue