aboutsummaryrefslogtreecommitdiff
path: root/converters/mpack/files/patch-xmalloc.c
blob: fa4b08b0424f35871b6b5081f9ebb542b0c696c5 (plain) (blame)
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
--- xmalloc.c.orig	Mon Jul 21 23:35:31 2003
+++ xmalloc.c	Sun Mar 26 23:07:02 2006
@@ -23,14 +23,14 @@
  * SOFTWARE.
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-extern char *malloc(), *realloc();
 
 char *xmalloc (int size)
 {
     char *ret;
 
-    if (ret = malloc((unsigned) size))
+    if ((ret = malloc((unsigned) size)))
       return ret;
 
     fprintf(stderr, "Memory exhausted\n");
@@ -43,7 +43,7 @@
     char *ret;
 
     /* xrealloc (NULL, size) behaves like xmalloc (size), as in ANSI C */
-    if (ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size))
+    if ((ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size)))
       return ret;
 
     fprintf(stderr, "Memory exhausted\n");