summaryrefslogtreecommitdiff
path: root/stalloc.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-02-17 02:28:26 +0100
committerPixel <pixel@nobis-crew.org>2009-02-17 02:28:26 +0100
commitffe1fca0cc4cac3213c048933314f4f4057e5991 (patch)
treea54aec864dda9a3bda649c6359d9227462dbbf84 /stalloc.c
parent2661812e3fc3f7385a5f8343172afc173f594efe (diff)
Fixing various warning / errors.
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;
}