for (int i = 0; (optind + i) < argc; i++) {
int file = open(argv[optind + i], O_RDONLY);
- int play = 0;
int ms = 0;
if (file < 0) {
while (1) {
static struct flight_data_record r; // flight_data_record is too large to be allocated ot the top of the stack !!!
+ int sleep;
if (get_record(file, &r) < 0) {
break;
}
if (opt_s > 0 && r.ms < opt_s) {
+ ms = r.ms;
continue;
}
break;
}
- if (play) {
- int sleep = r.ms - ms;
- if (sleep > 0) {
- usleep(sleep * 1000);
- }
+ if ((sleep = r.ms - ms) > 0) {
+ usleep(sleep * 1000);
}
ms = r.ms;