diff options
Diffstat (limited to 'alloc_re.c')
-rw-r--r-- | alloc_re.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/alloc_re.c b/alloc_re.c new file mode 100644 index 0000000..1074609 --- /dev/null +++ b/alloc_re.c | |||
@@ -0,0 +1,19 @@ | |||
1 | /* Public domain. */ | ||
2 | |||
3 | #include "alloc.h" | ||
4 | #include "byte.h" | ||
5 | |||
6 | int alloc_re(x,m,n) | ||
7 | char **x; | ||
8 | unsigned int m; | ||
9 | unsigned int n; | ||
10 | { | ||
11 | char *y; | ||
12 | |||
13 | y = alloc(n); | ||
14 | if (!y) return 0; | ||
15 | byte_copy(y,m,*x); | ||
16 | alloc_free(*x); | ||
17 | *x = y; | ||
18 | return 1; | ||
19 | } | ||