diff options
author | Bodo Möller <bodo@openssl.org> | 2000-01-21 17:11:26 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-01-21 17:11:26 +0000 |
commit | 674b8eec4c5992714fd98389c90534c215000d75 (patch) | |
tree | c85ddfbf484a774353a0f0fecf82278c91b05a5d /crypto | |
parent | 033db22d57bbe82e80d7e88c526daba008553d86 (diff) |
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).
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rand/randfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index f95ecb0e00..cf98643d3c 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -167,6 +167,8 @@ int RAND_write_file(const char *file) ret+=i; if (n <= 0) break; } + if (ret > 0) + ftruncate(fileno(out), ret); fclose(out); memset(buf,0,BUFSIZE); err: |