Path: blob/main/converters/mpack/files/patch-xmalloc.c
16151 views
--- xmalloc.c.orig Mon Jul 21 23:35:31 20031+++ xmalloc.c Sun Mar 26 23:07:02 20062@@ -23,14 +23,14 @@3* SOFTWARE.4*/5#include <stdio.h>6+#include <stdlib.h>7#include <string.h>8-extern char *malloc(), *realloc();910char *xmalloc (int size)11{12char *ret;1314- if (ret = malloc((unsigned) size))15+ if ((ret = malloc((unsigned) size)))16return ret;1718fprintf(stderr, "Memory exhausted\n");19@@ -43,7 +43,7 @@20char *ret;2122/* xrealloc (NULL, size) behaves like xmalloc (size), as in ANSI C */23- if (ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size))24+ if ((ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size)))25return ret;2627fprintf(stderr, "Memory exhausted\n");282930