summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-04-04 20:05:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-04-04 20:05:23 +0000
commitcb4a169f7551f1a2a3dfbdab045f9430aee1fc22 (patch)
treeee57928ba0d4ad433e162de1c23d0d27c31e8fa9 /ares_init.c
parentad046ba23920d58be45244ce8498588f32412e60 (diff)
downloadc-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.c6
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