fread and fwrite use size_t, not int

This commit is contained in:
Alam Ed Arias 2019-12-27 13:08:26 -05:00
parent ff004c4cf6
commit 0caa08defd
1 changed files with 3 additions and 3 deletions

View File

@ -2498,16 +2498,16 @@ static void Shittylogcopy(void)
{
char buf[8192];
FILE *fp;
int n;
size_t r;
if (fseek(logstream, 0, SEEK_SET) == -1)
{
Shittycopyerror("fseek");
}
else if (( fp = fopen(logfilename, "wt") ))
{
while (( n = fread(buf, 1, sizeof buf, logstream) ))
while (( r = fread(buf, 1, sizeof buf, logstream) ))
{
if (fwrite(buf, 1, n, fp) < n)
if (fwrite(buf, 1, r, fp) < r)
{
Shittycopyerror("fwrite");
break;