diff options
author | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
commit | 6343829a391df59e46e513c84b6264ee71ad9518 (patch) | |
tree | 9823103bf5828e47081ac906203516bdc332f577 /crypto/rand/randfile.c | |
parent | 2401debe83e8df930907a39065ebf9a54354f123 (diff) | |
download | openssl-6343829a391df59e46e513c84b6264ee71ad9518.tar.gz |
Revert the size_t modifications from HEAD that had led to more
knock-on work than expected - they've been extracted into a patch
series that can be completed elsewhere, or in a different branch,
before merging back to HEAD.
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r-- | crypto/rand/randfile.c | 10 |
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; |