提交 674b8eec 编写于 作者: B Bodo Möller

In RAND_write_file, truncate the file to the no. of bytes written

(we're now using fopen(..., "rb+") instead of fopen(..., "wb"),
so the file is not truncated automatically).
上级 033db22d
...@@ -167,6 +167,8 @@ int RAND_write_file(const char *file) ...@@ -167,6 +167,8 @@ int RAND_write_file(const char *file)
ret+=i; ret+=i;
if (n <= 0) break; if (n <= 0) break;
} }
if (ret > 0)
ftruncate(fileno(out), ret);
fclose(out); fclose(out);
memset(buf,0,BUFSIZE); memset(buf,0,BUFSIZE);
err: err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册