summaryrefslogtreecommitdiffstats
path: root/crypto/rand/randfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r--crypto/rand/randfile.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index c345d08541..c4e6160779 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -105,8 +105,7 @@ int RAND_load_file(const char *file, long bytes)
#ifndef OPENSSL_NO_POSIX_IO
struct stat sb;
#endif
- int i,ret=0;
- size_t n;
+ int i,ret=0,n;
FILE *in;
if (file == NULL) return(0);
@@ -163,8 +162,7 @@ err:
int RAND_write_file(const char *file)
{
unsigned char buf[BUFSIZE];
- int ret=0,rand_err=0;
- size_t i;
+ int i,ret=0,rand_err=0;
FILE *out = NULL;
int n;
#ifndef OPENSSL_NO_POSIX_IO
@@ -228,7 +226,7 @@ int RAND_write_file(const char *file)
if (out == NULL) goto err;
#ifndef NO_CHMOD
- chmod(file,(mode_t)0600);
+ chmod(file,0600);
#endif
n=RAND_DATA;
for (;;)
@@ -238,7 +236,7 @@ int RAND_write_file(const char *file)
if (RAND_bytes(buf,i) <= 0)
rand_err=1;
i=fwrite(buf,1,i,out);
- if (i == 0)
+ if (i <= 0)
{
ret=0;
break;