Index: source.c
===================================================================
--- source.c	(revision 472)
+++ source.c	(working copy)
@@ -346,6 +346,7 @@
     Symbol f;
     Address addr;
     char lineno[10];
+    String args[MAXNARGS];
 
     ed = getenv("EDITOR");
     if (ed == nil) {
@@ -371,9 +372,14 @@
 	sprintf(lineno, "+1");
     }
     if (streq(ed, "vi") or streq(ed, "ex")) {
-	call(ed, stdin, stdout, lineno, src, nil);
+	args[0] = lineno;
+	args[1] = src;
+	args[2] = NULL;
+	call(ed, stdin, stdout, args);
     } else {
-	call(ed, stdin, stdout, src, nil);
+	args[0] = src;
+	args[1] = NULL;
+	call(ed, stdin, stdout, args);
     }
 }
 
Index: makedefs.c
===================================================================
--- makedefs.c	(revision 472)
+++ makedefs.c	(working copy)
@@ -113,10 +113,18 @@
     copy();
     printf("#endif\n");
     if (tmp != NULL and not force) {
+	String args[MAXNARGS];
 	fclose(tmp);
-	r = call("cmp", stdin, stderr, "-s", tmpname, argv[2], nil);
+	args[0] = "-s";
+	args[1] = tmpname;
+	args[2] = argv[2];
+	args[3] = NULL;
+	r = call("cmp", stdin, stderr, args);
 	if (r != 0) {
-	    r = call("cp", stdin, stderr, tmpname, argv[2], nil);
+	    args[0] = tmpname;
+	    args[1] = argv[2];
+	    args[2] = NULL;
+	    r = call("cp", stdin, stderr, args);
 	    if (r != 0) {
 		fprintf(stderr, "can't create %s\n", argv[2]);
 	    }
Index: library.c
===================================================================
--- library.c	(revision 472)
+++ library.c	(working copy)
@@ -40,6 +40,8 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
 
 #define public
 #define and &&
@@ -104,22 +106,21 @@
  * The command's standard input and output are passed as FILE's.
  */
 
-
-#define MAXNARGS 1000    /* unchecked upper limit on max num of arguments */
+#define MAXNARGS 1000	/* unchecked upper limit on max num of arguments */
 #define BADEXEC 127	/* exec fails */
 
-#define ischild(pid)    ((pid) == 0)
+#define ischild(pid) ((pid) == 0)
 
 /* VARARGS3 */
 public int
-call(String name, File in, File out, String args)
+call(String name, File in, File out, String *args)
 {
     String *ap, *argp;
     String argv[MAXNARGS];
 
     argp = &argv[0];
     *argp++ = name;
-    ap = &args;
+    ap = args;
     while (*ap != nil(String)) {
 	*argp++ = *ap++;
     }
@@ -200,9 +201,13 @@
 	sh = DEF_SHELL;
     }
     if (s != nil(String) and *s != '\0') {
-	call(sh, stdin, stdout, "-c", s, 0);
+	String argv[MAXNARGS];
+	argv[0] = "-c";
+	argv[1] = s;
+	argv[2] = NULL;
+	call(sh, stdin, stdout, argv);
     } else {
-	call(sh, stdin, stdout, 0);
+	call(sh, stdin, stdout, NULL);
     }
 }
 
@@ -272,7 +277,7 @@
 }
 
 public
-pwait(int pid, *statusp)
+pwait(int pid, int *statusp)
 {
     Pidlist *p;
     int pnum, status;
@@ -516,9 +521,10 @@
 
 /* VARARGS2 */
 static
-errmsg(String errname, boolean shouldquit, String s, a, b, c, d, e, f, g, h,
-       i, j, k, l, m)
+errmsg(String errname, boolean shouldquit, String s, ...)
 {
+    va_list ap;
+
     fflush(stdout);
     if (shouldquit and cmdname != nil(String)) {
 	fprintf(stderr, "%s: ", cmdname);
@@ -532,7 +538,9 @@
     if (errname != nil(String)) {
 	fprintf(stderr, "%s: ", errname);
     }
-    fprintf(stderr, s, a, b, c, d, e, f, g, h, i, j, k, l, m);
+    va_start(ap, s);
+    fvprintf(stderr, s, ap);
+    va_end(ap);
     putc('\n', stderr);
     fflush(stderr);
     if (shouldquit) {
@@ -572,10 +580,14 @@
 
 /* VARARGS1 */
 public
-warning(String s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+warning(String s, ...)
 {
+    va_list ap;
+
     nwarnings++;
-    errmsg("warning", FALSE, s, a, b, c, d, e, f, g, h, i, j, k, l, m);
+    va_start(ap, s);
+    errmsg("warning", FALSE, s, ap);
+    va_end(ap);
 }
 
 /*
@@ -588,12 +600,15 @@
 
 /* VARARGS1 */
 public
-error(String s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+error(String s, ...)
 {
     extern erecover();
+    va_list ap;
 
     nerrs++;
-    errmsg(nil(String), FALSE, s, a, b, c, d, e, f, g, h, i, j, k, l, m);
+    va_start(ap, s);
+    errmsg(nil(String), FALSE, s, ap);
+    va_end(ap);
     erecover();
 }
 
@@ -603,9 +618,13 @@
 
 /* VARARGS1 */
 public
-fatal(String s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+fatal(String s, ...)
 {
-    errmsg("fatal error", TRUE, s, a, b, c, d, e, f, g, h, i, j, k, l, m);
+    va_list ap;
+
+    va_start(ap, s);
+    errmsg("fatal error", TRUE, s, ap);
+    va_end(ap);
 }
 
 /*
@@ -614,9 +633,13 @@
 
 /* VARARGS1 */
 public
-panic(String s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+panic(String s, ...)
 {
-    errmsg("internal error", TRUE, s, a, b, c, d, e, f, g, h, i, j, k, l, m);
+    va_list ap;
+
+    va_start(ap, s);
+    errmsg("internal error", TRUE, s, ap);
+    va_end(ap);
 }
 
 short
@@ -639,27 +662,25 @@
     return r;
 }
 
+#if 0
 /*
  * Recover from an error.
  *
  * This is the default routine which we aren't using since we have our own.
- *
+ */
 public erecover()
 {
 }
- *
- */
 
 /*
  * Default way to quit from a program is just to exit.
- *
+ */
 public quit(r)
 int r;
 {
     exit(r);
 }
- *
- */
+#endif
 
 /*
  * Compare n-byte areas pointed to by s1 and s2
@@ -730,8 +751,6 @@
     }
 }
 
-#include <string.h>
-
 public char *
 index(char *s, char c)
 {
Index: defs.h
===================================================================
--- defs.h	(revision 472)
+++ defs.h	(working copy)
@@ -96,12 +96,6 @@
 
 #undef FILE
 
-extern long atol();
-extern double atof();
-extern char *malloc();
-extern String strcpy(), index(), rindex();
-extern int strlen();
-
 extern String cmdname;
 extern String errfilename;
 extern short errlineno;
