diff options
author | cracauer <cracauer@FreeBSD.org> | 1999-06-25 09:04:48 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1999-06-25 09:04:48 +0000 |
commit | 93ee80e2fd7ce70f607cb2c3402d9202e4ccd03f (patch) | |
tree | c539739702964ebf1cfb42a0866c94c5ea1ed516 /bin/date | |
parent | 1823d8fdf691a11e672736945aadbe52a69ea664 (diff) | |
download | FreeBSD-src-93ee80e2fd7ce70f607cb2c3402d9202e4ccd03f.zip FreeBSD-src-93ee80e2fd7ce70f607cb2c3402d9202e4ccd03f.tar.gz |
Don't continue if parsing failed when -f is in use. Exit with nonzero value.
Diffstat (limited to 'bin/date')
-rw-r--r-- | bin/date/date.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index 5749417..f1d2e25 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -42,7 +42,7 @@ static char const copyright[] = static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: date.c,v 1.27 1999/03/09 09:38:54 brian Exp $"; + "$Id: date.c,v 1.28 1999/05/14 00:28:41 jmg Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -191,8 +191,7 @@ setthetime(fmt, p, jflag, nflag) if (t == NULL) { fprintf(stderr, "Failed conversion of ``%s''" " using format ``%s''\n", p, fmt); - lt = localtime(&tval); - return; + badformat(); } else if (*t != '\0') fprintf(stderr, "Warning: Ignoring %ld extraneous" " characters in date string (%s)\n", |