diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-04-04 20:05:23 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-04-04 20:05:23 +0000 |
commit | cb4a169f7551f1a2a3dfbdab045f9430aee1fc22 (patch) | |
tree | ee57928ba0d4ad433e162de1c23d0d27c31e8fa9 /ares_init.c | |
parent | ad046ba23920d58be45244ce8498588f32412e60 (diff) | |
download | c-ares-cb4a169f7551f1a2a3dfbdab045f9430aee1fc22.tar.gz c-ares-cb4a169f7551f1a2a3dfbdab045f9430aee1fc22.tar.bz2 c-ares-cb4a169f7551f1a2a3dfbdab045f9430aee1fc22.zip |
Eino Tuominen improved the code when a file is used to seed the randomizer
Diffstat (limited to 'ares_init.c')
-rw-r--r-- | ares_init.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ares_init.c b/ares_init.c index 0110f12..583f98f 100644 --- a/ares_init.c +++ b/ares_init.c @@ -1333,13 +1333,9 @@ static void randomize_key(unsigned char* key,int key_data_len) } #else /* !WIN32 */ #ifdef RANDOM_FILE - char buffer[256]; FILE *f = fopen(RANDOM_FILE, "rb"); if(f) { - size_t i; - size_t rc = fread(buffer, key_data_len, 1, f); - for(i=0; i<rc && counter < key_data_len; i++) - key[counter++]=buffer[i]; + counter = fread(key, 1, key_data_len, f); fclose(f); } #endif |