repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
tools/llvm: Do not build with symbols
[minix3.git]
/
external
/
bsd
/
flex
/
dist
/
lib
/
realloc.c
blob
25ff0db5fb6b994c5df5d9cbfa58b081b3f0e773
1
/* $NetBSD: realloc.c,v 1.1.1.1 2013/04/06 14:05:53 christos Exp $ */
2
3
#include <config.h>
4
5
#include <stdlib.h>
6
7
#include <errno.h>
8
9
void
*
rpl_realloc
(
void
*
p
,
size_t
n
)
10
{
11
void
*
result
;
12
13
if
(
n
==
0
)
14
{
15
n
=
1
;
16
}
17
18
if
(
p
==
NULL
)
19
{
20
result
=
malloc
(
n
);
21
}
22
else
23
result
=
realloc
(
p
,
n
);
24
25
if
(
result
==
NULL
)
26
errno
=
ENOMEM
;
27
28
return
result
;
29
}