aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc/fixlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fixinc/fixlib.c')
-rw-r--r--gcc/fixinc/fixlib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c
index 133aa8e..bafe261 100644
--- a/gcc/fixinc/fixlib.c
+++ b/gcc/fixinc/fixlib.c
@@ -24,6 +24,20 @@ Boston, MA 02111-1307, USA. */
#include "fixlib.h"
+void *
+must_malloc( siz )
+ size_t siz;
+{
+ void* res = malloc( siz );
+
+ if (res == (void*)NULL) {
+ fprintf( stderr, "fixincl failed to malloc %d bytes\n", siz );
+ exit( 3 );
+ }
+
+ return res;
+}
+
/* * * * * * * * * * * * *
load_file_data loads all the contents of a file into malloc-ed memory.