diff options
Diffstat (limited to 'coreutils/date.c')
-rw-r--r-- | coreutils/date.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 7f2a5b351..09ced0ea1 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -142,12 +142,11 @@ int date_main(int argc UNUSED_PARAM, char **argv) | |||
142 | } else { | 142 | } else { |
143 | parse_datestr(date_str, &tm_time); | 143 | parse_datestr(date_str, &tm_time); |
144 | } | 144 | } |
145 | |||
145 | /* Correct any day of week and day of year etc. fields */ | 146 | /* Correct any day of week and day of year etc. fields */ |
146 | tm_time.tm_isdst = -1; /* Be sure to recheck dst */ | 147 | tm_time.tm_isdst = -1; /* Be sure to recheck dst */ |
147 | tm = mktime(&tm_time); | 148 | tm = validate_tm_time(date_str, &tm_time); |
148 | if (tm < 0) { | 149 | |
149 | bb_error_msg_and_die(bb_msg_invalid_date, date_str); | ||
150 | } | ||
151 | maybe_set_utc(opt); | 150 | maybe_set_utc(opt); |
152 | 151 | ||
153 | /* if setting time, set it */ | 152 | /* if setting time, set it */ |