X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Frand%2Frandfile.c;h=3ae95f9012f1f3acb51a3787517a93d3815d1acb;hp=ad0e55db9047660fffa3906685bb5a0f8c961a27;hb=175b0942ec7e82f86831916d325922817872e657;hpb=eda1f21f1af8b6f77327e7b37573af9c1ba73726 diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index ad0e55db90..3ae95f9012 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -1,5 +1,5 @@ /* crypto/rand/randfile.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -57,9 +57,12 @@ */ #include -#include "cryptlib.h" +#include +#include +#include #include #include +#include "e_os.h" #include "rand.h" #undef BUFSIZE @@ -69,7 +72,7 @@ /* #define RFILE ".rand" - defined in ../../e_os.h */ int RAND_load_file(file,bytes) -char *file; +const char *file; long bytes; { MS_STATIC unsigned char buf[BUFSIZE]; @@ -81,12 +84,12 @@ long bytes; i=stat(file,&sb); /* If the state fails, put some crap in anyway */ - RAND_seed((unsigned char *)&sb,sizeof(sb)); + RAND_seed(&sb,sizeof(sb)); ret+=sizeof(sb); if (i < 0) return(0); if (bytes <= 0) return(ret); - in=fopen(file,"r"); + in=fopen(file,"rb"); if (in == NULL) goto err; for (;;) { @@ -106,7 +109,7 @@ err: } int RAND_write_file(file) -char *file; +const char *file; { unsigned char buf[BUFSIZE]; int i,ret=0;