diff options
author | Richard Levitte <levitte@openssl.org> | 2001-02-22 15:40:15 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-02-22 15:40:15 +0100 |
commit | 627774fd877b9aae249d937afa214d87d8964ae1 (patch) | |
tree | dc66ca3562c02a51b0f2c90d4cd3885c09d849ba /crypto/rand | |
parent | Use e_os2.h rather than opensslconf.h, since some needed macros are (diff) | |
download | openssl-627774fd877b9aae249d937afa214d87d8964ae1.tar.xz openssl-627774fd877b9aae249d937afa214d87d8964ae1.zip |
Since RAND_file_name() uses strlen, make sure the number that's
compared to it has the type size_t. Included the needed headers to
make that happen.
Diffstat (limited to 'crypto/rand')
-rw-r--r-- | crypto/rand/rand.h | 20 | ||||
-rw-r--r-- | crypto/rand/randfile.c | 4 |
2 files changed, 11 insertions, 13 deletions
diff --git a/crypto/rand/rand.h b/crypto/rand/rand.h index 6b276d05e2..d4d8fbe910 100644 --- a/crypto/rand/rand.h +++ b/crypto/rand/rand.h @@ -61,6 +61,12 @@ #include <openssl/e_os2.h> +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) +#include <windows.h> +#else +#include <sys/types.h> +#endif + #ifdef __cplusplus extern "C" { #endif @@ -91,7 +97,7 @@ void RAND_seed(const void *buf,int num); void RAND_add(const void *buf,int num,double entropy); int RAND_load_file(const char *file,long max_bytes); int RAND_write_file(const char *file); -const char *RAND_file_name(char *file,int num); +const char *RAND_file_name(char *file,size_t num); int RAND_status(void); int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); int RAND_egd(const char *path); @@ -99,24 +105,16 @@ int RAND_egd_bytes(const char *path,int bytes); void ERR_load_RAND_strings(void); int RAND_poll(void); -#ifdef __cplusplus -} -#endif - #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) -#include <windows.h> - -#ifdef __cplusplus -extern "C" { -#endif void RAND_screen(void); int RAND_event(UINT, WPARAM, LPARAM); +#endif + #ifdef __cplusplus } #endif -#endif /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index ec137c4e31..8623e13e18 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -61,7 +61,7 @@ #include <stdlib.h> #include <string.h> -#include <openssl/e_os.h> +#include "e_os.h" #include <openssl/crypto.h> #include <openssl/rand.h> @@ -194,7 +194,7 @@ err: return (rand_err ? -1 : ret); } -const char *RAND_file_name(char *buf, int size) +const char *RAND_file_name(char *buf, size_t size) { char *s=NULL; char *ret=NULL; |