mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Put some sanity checks on the times that can be input.
This commit is contained in:
parent
71eff46098
commit
ed7389e87e
2
main.c
2
main.c
@ -1097,6 +1097,8 @@ static char *set_schedtime(const char *arg, struct schedtime *st)
|
||||
{
|
||||
if (sscanf(arg, "%d:%d", &st->tm.tm_hour, &st->tm.tm_min) != 2)
|
||||
return "Invalid time set, should be HH:MM";
|
||||
if (st->tm.tm_hour > 23 || st->tm.tm_min > 59 || st->tm.tm_hour < 0 || st->tm.tm_min < 0)
|
||||
return "Invalid time set.";
|
||||
st->enable = true;
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user