Add support for entering times in 24 hour format
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
committed by
Lukas Fleischer
parent
7e7987575a
commit
65dc584662
@@ -740,9 +740,11 @@ int parse_time(const char *string, unsigned *hour, unsigned *minute)
|
||||
if (*p == ':') {
|
||||
if ((++n) > 1)
|
||||
return 0;
|
||||
} else if ((*p >= '0') && (*p <= '9'))
|
||||
} else if ((*p >= '0') && (*p <= '9')) {
|
||||
if ((n == 0) && (p == (string + 2)) && *(p + 1))
|
||||
n++;
|
||||
in[n] = in[n] * 10 + (int)(*p - '0');
|
||||
else
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user