Commit cbe3e29e authored by David Anderson's avatar David Anderson
Browse files

Merge pull request #1405 from serval2412/master

cppcheck: fix 1 kind of reports
parents 428d19f3 efdc5601
......@@ -173,7 +173,7 @@ _DC_get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
int c;
buf= malloc(bs);
i= 0;
......@@ -185,10 +185,10 @@ _DC_get_file(char *fn)
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
buf[i]= (char)c;
i++;
buf[i]= '\0';
}
buf[i]= '\0';
fclose(f);
}
return(buf);
......@@ -363,7 +363,7 @@ _DC_read_message(char *box, char *name, int del_msg)
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
int c;
buf= malloc(bs);
i= 0;
......@@ -375,10 +375,10 @@ _DC_read_message(char *box, char *name, int del_msg)
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
buf[i]= (char)c;
i++;
buf[i]= '\0';
}
buf[i]= '\0';
fclose(f);
if (del_msg)
unlink(fn);
......
......@@ -32,7 +32,7 @@ get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
int c;
buf= malloc(bs);
i= 0;
......@@ -44,10 +44,10 @@ get_file(char *fn)
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
buf[i]= (char)c;
i++;
buf[i]= '\0';
}
buf[i]= '\0';
fclose(f);
}
return(buf);
......
......@@ -177,7 +177,7 @@ _DC_get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
int c;
buf= malloc(bs);
i= 0;
......@@ -189,10 +189,10 @@ _DC_get_file(char *fn)
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
buf[i]= (char)c;
i++;
buf[i]= '\0';
}
buf[i]= '\0';
fclose(f);
}
return(buf);
......@@ -367,7 +367,7 @@ _DC_read_message(char *box, char *name, int del_msg)
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
int c;
buf= malloc(bs);
i= 0;
......@@ -379,10 +379,10 @@ _DC_read_message(char *box, char *name, int del_msg)
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
buf[i]= (char)c;
i++;
buf[i]= '\0';
}
buf[i]= '\0';
fclose(f);
if (del_msg)
unlink(fn);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment