Use err(3).

Simplification: if(a == 12) a -= 12 -> if(a == 12) a = 0.
This commit is contained in:
Philippe Charnier 1997-06-23 06:44:18 +00:00
parent 911091e7fc
commit 12d20ef97d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26835
2 changed files with 10 additions and 8 deletions

View File

@ -37,7 +37,7 @@
/* File scope variables */
static char rcsid[] = "$Id$";
static char rcsid[] = "$Id: panic.c,v 1.6 1997/02/22 19:54:06 peter Exp $";
/* External variables */
@ -70,9 +70,8 @@ perr(char *a)
void
usage(void)
{
/* Print usage and exit.
*/
fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-m] time\n"
/* Print usage and exit. */
fprintf(stderr, "usage: at [-V] [-q x] [-f file] [-m] time\n"
" at [-V] -c job [job ...]\n"
" atq [-V] [-q x] [-v]\n"
" atrm [-V] job [job ...]\n"

View File

@ -31,6 +31,8 @@
* |MIDNIGHT | |[DAY OF WEEK] |
* \TEATIME / |NUMBER [SLASH NUMBER [SLASH NUMBER]]|
* \PLUS NUMBER MINUTES|HOURS|DAYS|WEEKS/
*
* $Id$
*/
/* System Headers */
@ -47,6 +49,7 @@
#ifndef __FreeBSD__
#include <getopt.h>
#endif
#include <err.h>
/* Local headers */
@ -130,7 +133,7 @@ static size_t sc_len; /* scanner - lenght of token buffer */
static int sc_tokid; /* scanner - token id */
static int sc_tokplur; /* scanner - is token plural? */
static char rcsid[] = "$Id$";
static char rcsid[] = "$Id: parsetime.c,v 1.9 1997/02/22 19:54:07 peter Exp $";
/* Local functions */
@ -323,7 +326,7 @@ plus(struct tm *tm)
delay *= 60;
case MINUTES:
if (expectplur != sc_tokplur)
fprintf(stderr, "at: pluralization is wrong\n");
warnx("pluralization is wrong");
dateadd(delay, tm);
return;
}
@ -369,10 +372,10 @@ tod(struct tm *tm)
if (sc_tokid == PM) {
if (hour != 12) /* 12:xx PM is 12:xx, not 24:xx */
hour += 12;
hour += 12;
} else {
if (hour == 12) /* 12:xx AM is 00:xx, not 12:xx */
hour -= 12;
hour = 0;
}
token();
}