We're responsible for cleaning up afterwards.
while (1) {
if (category->time_limit > 0.0) {
while (1) {
if (category->time_limit > 0.0) {
- readline ("The next one is timed. Press enter when ready:");
+ response = readline ("The next one is timed. Press enter when ready:");
+ free (response);
}
printf ("%s\n", item->challenge);
}
printf ("%s\n", item->challenge);
- if (response[0] == '/')
+ if (response[0] == '/') {
mnemon_handle_command (mnemon, response + 1);
mnemon_handle_command (mnemon, response + 1);
+ free (response);
+ } else {
}
mnemon_handle_response (mnemon, bin, item_index,
}
mnemon_handle_response (mnemon, bin, item_index,
(end.tv_sec + end.tv_usec / 1e6) -
(start.tv_sec + start.tv_usec / 1e6),
category->time_limit);
(end.tv_sec + end.tv_usec / 1e6) -
(start.tv_sec + start.tv_usec / 1e6),
category->time_limit);
} while (mnemon->to_introduce ||
mnemon->unlearned ||
mnemon->to_master > 0);
} while (mnemon->to_introduce ||
mnemon->unlearned ||
mnemon->to_master > 0);