Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/converters/mpack/files/patch-xmalloc.c
16151 views
1
--- xmalloc.c.orig Mon Jul 21 23:35:31 2003
2
+++ xmalloc.c Sun Mar 26 23:07:02 2006
3
@@ -23,14 +23,14 @@
4
* SOFTWARE.
5
*/
6
#include <stdio.h>
7
+#include <stdlib.h>
8
#include <string.h>
9
-extern char *malloc(), *realloc();
10
11
char *xmalloc (int size)
12
{
13
char *ret;
14
15
- if (ret = malloc((unsigned) size))
16
+ if ((ret = malloc((unsigned) size)))
17
return ret;
18
19
fprintf(stderr, "Memory exhausted\n");
20
@@ -43,7 +43,7 @@
21
char *ret;
22
23
/* xrealloc (NULL, size) behaves like xmalloc (size), as in ANSI C */
24
- if (ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size))
25
+ if ((ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size)))
26
return ret;
27
28
fprintf(stderr, "Memory exhausted\n");
29
30