$NetBSD$

- use standard headers
- fix malloc usage

--- lib-src/sorted-doc.c~	1992-10-07 18:21:09.000000000 +0000
+++ lib-src/sorted-doc.c
@@ -6,11 +6,10 @@
    */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 
-extern char *malloc ();
-char *xmalloc ();
-
 #define NUL	'\0'
 #define MARKER '\037'
 
@@ -56,9 +55,8 @@ error (s1, s2)
 
 /* Like malloc but get fatal error if memory is exhausted.  */
 
-char *
-xmalloc (size)
-     int size;
+void *
+xmalloc (size_t size)
 {
   char *result = malloc ((unsigned)size);
   if (result == NULL)
