File: realloc.c

package info (click to toggle)
libtrace3 3.0.14-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,492 kB
  • sloc: ansic: 21,584; sh: 10,236; cpp: 1,765; makefile: 454; yacc: 96; lex: 50
file content (22 lines) | stat: -rw-r--r-- 300 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif
#undef realloc

#include <sys/types.h>
#include <stdlib.h>

void *realloc ();


/* If N is zero, allocate a 1-byte block */
void *
rpl_realloc(void *ptr,size_t n)
{
	
	if (n == 0)
		n = 1;
	if (ptr == 0)
		return malloc(n);
	return realloc(ptr,n);
}