mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:23:40 +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
|
|
@ -58,14 +58,14 @@ struct getout *new_getout(struct OperationConfig *config)
|
|||
|
||||
ParameterError file2string(char **bufp, FILE *file)
|
||||
{
|
||||
char buffer[256];
|
||||
char *ptr;
|
||||
char *string = NULL;
|
||||
size_t stringlen = 0;
|
||||
size_t buflen;
|
||||
|
||||
if(file) {
|
||||
char buffer[256];
|
||||
size_t stringlen = 0;
|
||||
while(fgets(buffer, sizeof(buffer), file)) {
|
||||
size_t buflen;
|
||||
ptr = strchr(buffer, '\r');
|
||||
if(ptr)
|
||||
*ptr = '\0';
|
||||
|
|
@ -91,11 +91,11 @@ ParameterError file2memory(char **bufp, size_t *size, FILE *file)
|
|||
{
|
||||
char *newbuf;
|
||||
char *buffer = NULL;
|
||||
size_t alloc = 512;
|
||||
size_t nused = 0;
|
||||
size_t nread;
|
||||
|
||||
if(file) {
|
||||
size_t nread;
|
||||
size_t alloc = 512;
|
||||
do {
|
||||
if(!buffer || (alloc == nused)) {
|
||||
/* size_t overflow detection for huge files */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue