diff options
author | Patrick McHardy <kaber@trash.net> | 2015-04-11 14:56:16 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-04-12 19:59:27 +0100 |
commit | 262b97bd112cbaed098c7941bd452c7b16a89646 (patch) | |
tree | f285638770d221411e5584962aae9f190d43c6b8 /src/datatype.c | |
parent | 87908ff7a12c969ca21338ab7ed27ed93a9b09c3 (diff) |
datatype: less strict time parsing
Don't require hours to be in range 0-23 and minutes/seconds in range 0-59.
The time_type is used for relative times where it is entirely reasonable
to specify 180s instead of 3m.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/datatype.c')
-rw-r--r-- | src/datatype.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/datatype.c b/src/datatype.c index 0772b507..1c837152 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -831,10 +831,6 @@ static struct error_record *time_type_parse(const struct expr *sym, } h = str2int(tmp, c, k); k = 0; - if (h > 23) { - return error(&sym->location, - "Hour needs to be 0-23"); - } mask |= HOUR; break; case 'm': @@ -844,10 +840,6 @@ static struct error_record *time_type_parse(const struct expr *sym, } m = str2int(tmp, c, k); k = 0; - if (m > 59) { - return error(&sym->location, - "Minute needs to be 0-59"); - } mask |= MIN; break; case 's': @@ -857,10 +849,6 @@ static struct error_record *time_type_parse(const struct expr *sym, } s = str2int(tmp, c, k); k = 0; - if (s > 59) { - return error(&sym->location, - "second needs to be 0-59"); - } mask |= SECS; break; default: |