summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-03-24 03:07:05 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-03-24 03:07:05 +0000
commit0415443373397b2354bf4a02f30d7e949d19efc7 (patch)
tree0473a5e99579c373970361cc28a456277d8f35c1 /usr.bin/cvs
parentb0631f1ce3ba4aecaa18ce460a7fbe59efb2c1cf (diff)
add missing prototypes for standard yacc functions and make yyerror()
accept a format with variable arguments
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/date.y22
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/cvs/date.y b/usr.bin/cvs/date.y
index 6bd89421af7..4e069844157 100644
--- a/usr.bin/cvs/date.y
+++ b/usr.bin/cvs/date.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: date.y,v 1.1 2005/03/23 20:00:18 jfb Exp $ */
+/* $OpenBSD: date.y,v 1.2 2005/03/24 03:07:04 jfb Exp $ */
/*
** Originally written by Steven M. Bellovin <smb@research.att.com> while
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -79,6 +80,12 @@ static MERIDIAN yyMeridian;
static time_t yyRelMonth;
static time_t yyRelSeconds;
+
+static int yyerror (const char *, ...);
+static int yylex (void);
+static int yyparse (void);
+
+
%}
%union {
@@ -488,9 +495,14 @@ static TABLE const MilitaryTable[] = {
/* ARGSUSED */
static int
-yyerror(char *s)
+yyerror(const char *fmt, ...)
{
- cvs_log(LP_ERR, "%s", s);
+ va_list vap;
+
+ va_start(vap, fmt);
+ cvs_vlog(LP_ERR, fmt, vap);
+ va_end(vap);
+
return (0);
}
@@ -804,9 +816,7 @@ get_date(char *p, struct timeb *now)
{
struct tm *tm, gmt;
struct timeb ftz;
- time_t Start;
- time_t tod;
- time_t nowtime;
+ time_t Start, tod, nowtime;
yyInput = p;
if (now == NULL) {