summaryrefslogtreecommitdiff
path: root/alloc_re.c
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2015-05-08 23:07:47 -0400
committerjoe <joe@jerkface.net>2015-05-08 23:07:47 -0400
commit220534453eecc2c07ad710d72268aafd20b83138 (patch)
tree469bd5db135e31b7ea908152aa3389b9b1e06d5b /alloc_re.c
initial commit
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}