X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=random-word.c;h=d751d069ab21676fa2a89bf98e0c5f59a995dc34;hb=5d64fdd9c5db876d754c75a1d20c17bf150fdeb4;hp=b55bd1d92ba30f356c89965da2f51c0aaae9f70d;hpb=240305aa4d362226d0850a897fefba004cb113b0;p=cmccabe-bin diff --git a/random-word.c b/random-word.c index b55bd1d..d751d06 100644 --- a/random-word.c +++ b/random-word.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #define DICT "/usr/share/dict/linux.words" #define STARTING_SZ 8192 @@ -91,7 +91,10 @@ int main(void) FILE *fp; const char *word; struct dict *dict; - srandom(time(NULL)); + struct timeval tv; + + gettimeofday(&tv, NULL); + srandom(tv.tv_usec * tv.tv_sec); fp = fopen(DICT, "r"); if (! fp) {