File: util.c

package info (click to toggle)
xdemineur 2.1.1-21
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 436 kB
  • sloc: ansic: 1,314; makefile: 8
file content (37 lines) | stat: -rw-r--r-- 1,021 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright  1993-1999 Marc Baudoin <babafou@babafou.eu.org>
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose and without fee is hereby
 * granted, provided that the above copyright notice appear in all
 * copies and that both that copyright notice and this permission
 * notice appear in supporting documentation.  The author makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 */

static char *const cvsid = "$Id: util.c,v 1.1.1.1.2.1 1999/07/29 21:25:32 babafou Exp $" ;

#include <sys/types.h>

#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>

/* ------------------------------------------------------------------------- */

void *xmalloc ( size_t size )
{
   void *ptr ;

   ptr = malloc ( size ) ;
   if ( ptr == NULL )
   {
      fprintf ( stderr , "Can't allocate memory.\n" ) ;
      exit ( EX_SOFTWARE ) ;
   }

   return ptr ;
}