summaryrefslogtreecommitdiff
path: root/stalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'stalloc.c')
-rw-r--r--stalloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/stalloc.c b/stalloc.c
index f8abb22..27e3288 100644
--- a/stalloc.c
+++ b/stalloc.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+#include <string.h>
static int nb_pools = 0;
static char ** mem_pools = 0;
@@ -41,13 +42,13 @@ void * st_alloc(size_t s) {
pools_size[pool] += s;
- return mem_pools[pool] + pool_size[pool] - s;
+ return mem_pools[pool] + pools_size[pool] - s;
}
char * st_strdup(const char * src) {
int s = strlen(src) + 1;
- char * r = (char *) st_alloc(s)
- memcpy(r, src);
+ char * r = (char *) st_alloc(s);
+ memcpy(r, src, s);
return r;
}