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) ...@@ -173,7 +173,7 @@ _DC_get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL) if ((f= fopen(fn, "r")) != NULL)
{ {
int bs= 100, i; int bs= 100, i;
char c; int c;
buf= malloc(bs); buf= malloc(bs);
i= 0; i= 0;
...@@ -185,10 +185,10 @@ _DC_get_file(char *fn) ...@@ -185,10 +185,10 @@ _DC_get_file(char *fn)
bs+= 100; bs+= 100;
buf= realloc(buf, bs); buf= realloc(buf, bs);
} }
buf[i]= c; buf[i]= (char)c;
i++; i++;
buf[i]= '\0';
} }
buf[i]= '\0';
fclose(f); fclose(f);
} }
return(buf); return(buf);
...@@ -363,7 +363,7 @@ _DC_read_message(char *box, char *name, int del_msg) ...@@ -363,7 +363,7 @@ _DC_read_message(char *box, char *name, int del_msg)
if ((f= fopen(fn, "r")) != NULL) if ((f= fopen(fn, "r")) != NULL)
{ {
int bs= 100, i; int bs= 100, i;
char c; int c;
buf= malloc(bs); buf= malloc(bs);
i= 0; i= 0;
...@@ -375,10 +375,10 @@ _DC_read_message(char *box, char *name, int del_msg) ...@@ -375,10 +375,10 @@ _DC_read_message(char *box, char *name, int del_msg)
bs+= 100; bs+= 100;
buf= realloc(buf, bs); buf= realloc(buf, bs);
} }
buf[i]= c; buf[i]= (char)c;
i++; i++;
buf[i]= '\0';
} }
buf[i]= '\0';
fclose(f); fclose(f);
if (del_msg) if (del_msg)
unlink(fn); unlink(fn);
......
...@@ -32,7 +32,7 @@ get_file(char *fn) ...@@ -32,7 +32,7 @@ get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL) if ((f= fopen(fn, "r")) != NULL)
{ {
int bs= 100, i; int bs= 100, i;
char c; int c;
buf= malloc(bs); buf= malloc(bs);
i= 0; i= 0;
...@@ -44,10 +44,10 @@ get_file(char *fn) ...@@ -44,10 +44,10 @@ get_file(char *fn)
bs+= 100; bs+= 100;
buf= realloc(buf, bs); buf= realloc(buf, bs);
} }
buf[i]= c; buf[i]= (char)c;
i++; i++;
buf[i]= '\0';
} }
buf[i]= '\0';
fclose(f); fclose(f);
} }
return(buf); return(buf);
......
...@@ -177,7 +177,7 @@ _DC_get_file(char *fn) ...@@ -177,7 +177,7 @@ _DC_get_file(char *fn)
if ((f= fopen(fn, "r")) != NULL) if ((f= fopen(fn, "r")) != NULL)
{ {
int bs= 100, i; int bs= 100, i;
char c; int c;
buf= malloc(bs); buf= malloc(bs);
i= 0; i= 0;
...@@ -189,10 +189,10 @@ _DC_get_file(char *fn) ...@@ -189,10 +189,10 @@ _DC_get_file(char *fn)
bs+= 100; bs+= 100;
buf= realloc(buf, bs); buf= realloc(buf, bs);
} }
buf[i]= c; buf[i]= (char)c;
i++; i++;
buf[i]= '\0';
} }
buf[i]= '\0';
fclose(f); fclose(f);
} }
return(buf); return(buf);
...@@ -367,7 +367,7 @@ _DC_read_message(char *box, char *name, int del_msg) ...@@ -367,7 +367,7 @@ _DC_read_message(char *box, char *name, int del_msg)
if ((f= fopen(fn, "r")) != NULL) if ((f= fopen(fn, "r")) != NULL)
{ {
int bs= 100, i; int bs= 100, i;
char c; int c;
buf= malloc(bs); buf= malloc(bs);
i= 0; i= 0;
...@@ -379,10 +379,10 @@ _DC_read_message(char *box, char *name, int del_msg) ...@@ -379,10 +379,10 @@ _DC_read_message(char *box, char *name, int del_msg)
bs+= 100; bs+= 100;
buf= realloc(buf, bs); buf= realloc(buf, bs);
} }
buf[i]= c; buf[i]= (char)c;
i++; i++;
buf[i]= '\0';
} }
buf[i]= '\0';
fclose(f); fclose(f);
if (del_msg) if (del_msg)
unlink(fn); 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