Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
2
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
3
#include 
4
#include 
5
#include 
6
 
7
static char msg[] = "Fatal: xrealloc would have returned NULL\r\n";
8
 
9
void * xrealloc(void *ptr, size_t _sz);
10
void *
11
xrealloc(void *ptr, size_t _sz)
12
{
13
  void *rv;
14
 
15
  if (ptr == 0)
16
    rv = malloc(_sz?_sz:1);
17
  else
18
    rv = realloc(ptr, _sz?_sz:1);
19
 
20
  if (rv == 0)
21
  {
22
    __libclog_printf(msg);
23
    _exit(1);
24
  }
25
  return rv;
26
}