aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
blob: 022e04b06aa3f961ca84cb766e0b2cf715b3571e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * util.c:
 *
 * Copyright (c) 2017 James McKenzie <foss@madingley.org>,
 * All rights reserved.
 *
 */

#include "project.h"

void *
xmalloc (size_t s)
{
  void *ret = malloc (s);

  if (!ret)
    {
      fprintf (stderr, "malloc(%lu) failed - aborting\n", s);
      exit (1);
    }

  return ret;
}