summaryrefslogtreecommitdiff
path: root/x11/xmx/patches/patch-cl
blob: 0ee56fcd59fca8242c0a0621530d433e6b84e823 (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
$NetBSD: patch-cl,v 1.2 2011/07/03 20:15:59 dholland Exp $

- use modern C

--- server/pp.c~	1998-04-23 18:19:10.000000000 -0400
+++ server/pp.c	2008-08-31 01:39:38.000000000 -0400
@@ -29,6 +29,8 @@
 *	They don't belong anywhere else, so they're here.		*
 *									*
 ************************************************************************/
+#include <stdlib.h>
+#include <string.h>
 #define NEED_REPLIES
 #define NEED_EVENTS
 #include <X11/Xproto.h>
@@ -62,8 +64,12 @@ pp_new
       pp = ppfree;
       ppfree = ppfree->next;
    }
-   else if (MALLOC(pp, pp_t *, sizeof(pp_t)))
-      return (pp_t *)err(0, "malloc returned zero");
+   else if (MALLOC(pp, pp_t *, sizeof(pp_t))) {
+      /* this err returns its first argument */
+      /*return (pp_t *)err(0, "malloc returned zero");*/
+      err(0, "malloc returned zero");
+      return NULL;
+   }
 
    return pp;
 }