repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
etc/services - sync with NetBSD-8
[minix.git]
/
external
/
bsd
/
flex
/
dist
/
lib
/
realloc.c
blob
d7bb6292dcdac66c81f9106e636b53f512fda51f
1
#include <config.h>
2
3
#include <stdlib.h>
4
5
#include <errno.h>
6
7
void
*
rpl_realloc
(
void
*
p
,
size_t
n
)
8
{
9
void
*
result
;
10
11
if
(
n
==
0
)
12
{
13
n
=
1
;
14
}
15
16
if
(
p
==
NULL
)
17
{
18
result
=
malloc
(
n
);
19
}
20
else
21
result
=
realloc
(
p
,
n
);
22
23
if
(
result
==
NULL
)
24
errno
=
ENOMEM
;
25
26
return
result
;
27
}