summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libregex/test/xmalloc.c
blob: aa1c6c44f7f5de7d114a3a91bbb6d9a631f46630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
extern char *malloc ();

#ifndef NULL
#define NULL 0
#endif

void *
xmalloc (size)
  unsigned size;
{
  char *new_mem = malloc (size);

  if (new_mem == NULL)
    {
      fprintf (stderr, "xmalloc: request for %u bytes failed.\n", size);
      abort ();
    }

  return new_mem;
}
OpenPOWER on IntegriCloud