summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfb <jfb@openbsd.org>2005-03-24 03:07:04 +0000
committerjfb <jfb@openbsd.org>2005-03-24 03:07:04 +0000
commitcd1dc9e82f38e83c3d5341ce44c5b622dd0d7ff3 (patch)
treed484503c2c0cb2c979c06bacdd6870384e94af0a
parentalways good to check for invalid values. ok marius pedro (diff)
downloadwireguard-openbsd-cd1dc9e82f38e83c3d5341ce44c5b622dd0d7ff3.tar.xz
wireguard-openbsd-cd1dc9e82f38e83c3d5341ce44c5b622dd0d7ff3.zip
add missing prototypes for standard yacc functions and make yyerror()
accept a format with variable arguments
-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) {