Seed using gettimeofday(2) rather than time(2).
Seeding with time(2) gave some humorous results because we could get the
same word back multiple times if the program was invoked multiple times
a second.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
+#include <sys/time.h>
#define DICT "/usr/share/dict/linux.words"
#define STARTING_SZ 8192
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) {