aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
blob: 11796ceab0991e77585d6baf0a7bbf94112fa041 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "util.h"

void* xmalloc(size_t size)
{
  void *block = malloc(size);
  if (!block) {
    perror("malloc");
    exit(1);
  }
  memset(block, 0, size);
  return block;
}