summaryrefslogtreecommitdiff
path: root/alloc_re.c
diff options
context:
space:
mode:
Diffstat (limited to 'alloc_re.c')
-rw-r--r--alloc_re.c19
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
6int alloc_re(x,m,n)
7char **x;
8unsigned int m;
9unsigned 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}