+ else if (opt_pass == 2 && opt_ts)
+ pr_error_exit(1, "seed already contains a timestamp; cannot over-ride it");
+ else if (opt_ts == 1 || opt_pass == 2) { // no timestamp provided; use NOW
+ ts = time(NULL);
+ if (ts)
+ snprintf(timestamp, TIMESTAMP_SIZE + 1, "%08lX", ts);
+ }
+
+ if (opt_pass == 2) { // try to figure out the correct date-time from the seed
+ // inherits the most significant 2 characters from the NOW time
+ strncpy(timestamp+2, seed, 6);
+ time_t tmp;
+ if (sscanf(timestamp, "%08lx", &tmp))
+ if (tmp > ts-3600 && tmp < ts+3600) // timestamps are so close they must be for the same date
+ ts = tmp;
+ }