#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);
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
if (out == NULL) goto err;
#ifndef NO_CHMOD
- chmod(file,(mode_t)0600);
+ chmod(file,0600);
#endif
n=RAND_DATA;
for (;;)
if (RAND_bytes(buf,i) <= 0)
rand_err=1;
i=fwrite(buf,1,i,out);
- if (i == 0)
+ if (i <= 0)
{
ret=0;
break;