diff options
author | Pixel <pixel@nobis-crew.org> | 2009-02-17 02:28:26 +0100 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-02-17 02:28:26 +0100 |
commit | ffe1fca0cc4cac3213c048933314f4f4057e5991 (patch) | |
tree | a54aec864dda9a3bda649c6359d9227462dbbf84 /stalloc.c | |
parent | 2661812e3fc3f7385a5f8343172afc173f594efe (diff) |
Fixing various warning / errors.
Diffstat (limited to 'stalloc.c')
-rw-r--r-- | stalloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |