freebsd-ports/converters/mpack/files/patch-xmalloc.c
Andrey Slusar ae2643a80f - Change TMPDIR to /tmp. [1]
- Don't use O_EXCL. [1]
- Rename touched patches to patch-<patched file> format.
- Import some fixes from Debian.

PR:		ports/93967 [1]
Submitted by:	Paul Schmehl <pauls@utdallas.edu> [1]
2006-03-26 20:45:42 +00:00

28 lines
756 B
C

--- 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");