summaryrefslogtreecommitdiff
path: root/editors/mule/patches/patch-bw
blob: a41c725f7d804f5393f3fb5a678272af86692887 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
$NetBSD: patch-bw,v 1.2 2011/12/24 17:07:07 dholland Exp $

- use standard headers
- don't declare own errno
- fix malloc usage

--- lib-src/movemail.c.orig	1994-08-04 23:15:22.000000000 +0000
+++ lib-src/movemail.c
@@ -54,6 +54,9 @@ the Free Software Foundation, 675 Mass A
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <../src/syswait.h>
 
 #ifdef MSDOS
@@ -98,7 +101,7 @@ extern int lk_open (), lk_close ();
 #undef close
 
 char *concat ();
-char *xmalloc ();
+void *xmalloc (size_t);
 #ifndef errno
 extern int errno;
 #endif
@@ -370,7 +373,6 @@ error (s1, s2, s3)
 pfatal_with_name (name)
      char *name;
 {
-  extern int errno;
   extern char *strerror ();
   char *s;
 
@@ -381,7 +383,6 @@ pfatal_with_name (name)
 pfatal_and_delete (name)
      char *name;
 {
-  extern int errno;
   extern char *strerror ();
   char *s;
 
@@ -409,11 +410,10 @@ concat (s1, s2, s3)
 
 /* Like malloc but get fatal error if memory is exhausted.  */
 
-char *
-xmalloc (size)
-     unsigned size;
+void *
+xmalloc (size_t size)
 {
-  char *result = (char *) malloc (size);
+  void *result = (char *) malloc (size);
   if (!result)
     fatal ("virtual memory exhausted", 0);
   return result;
@@ -747,7 +747,6 @@ multiline (buf, n, f)
 char *
 get_errmsg ()
 {
-  extern int errno;
   extern char *strerror ();
   return strerror (errno);
 }