1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
--- lib/error.c.orig Wed Nov 15 04:19:40 1989
+++ lib/error.c Wed Oct 15 06:38:57 2003
@@ -18,7 +18,8 @@
*/
#include <stdio.h>
-#include <varargs.h>
+#include <stdarg.h>
+#include <errno.h>
#ifdef lint
@@ -31,20 +32,15 @@
#else lint
extern char *ProgName;
-extern int errno;
-extern char *sys_errlist[];
-extern int sys_nerr;
-error(va_alist)
- va_dcl
+error(char *fmt,...)
{
va_list l;
int quit, e;
- char *fmt;
(void) fflush(stdout); /* sync error messages */
(void) fprintf(stderr, "%s: ", ProgName);
- va_start(l);
+ va_start(l,fmt);
/* pick up the constant arguments: quit, errno, printf format */
quit = va_arg(l, int);
e = va_arg(l, int);
@@ -69,15 +65,13 @@
exit(quit);
}
-panic(va_alist)
- va_dcl
+panic(char *fmt,...)
{
va_list l;
- char *fmt;
(void) fflush(stdout);
(void) fprintf(stderr, "%s: panic: ", ProgName);
- va_start(l);
+ va_start(l,fmt);
/* pick up the constant argument: printf format */
fmt = va_arg(l, char *);
#if defined(sys5) || defined(HAVE_VPRINTF)
|