pkgsrc/editors/mule/patches/patch-bw
dholland 918e692115 Adjust the amd64 patch by crosschecking the existing header for alpha.
Patch extensive use of malloc and alloca without <stdlib.h> and some
other stuff that showed up in the build log.

Still crashes in temacs but it's getting much farther.
2011-12-24 17:07:07 +00:00

66 lines
1.4 KiB
Text

$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);
}