summaryrefslogtreecommitdiff
path: root/src/common/string.c
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 17:42:36 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 17:42:36 +0200
commite9683297bf480f9590b0e5796f4520fb430e2e03 (patch)
tree93ef75cd154edf4c342d0a22cd56eb3670feb2b5 /src/common/string.c
parente8cf65c07d78e3cfbac953b1b97c51998a5900df (diff)
downloadTCE-e9683297bf480f9590b0e5796f4520fb430e2e03.tar.gz
TCE-e9683297bf480f9590b0e5796f4520fb430e2e03.zip
Now using Doug Lea's malloc for userland too. And improved stability.
Diffstat (limited to 'src/common/string.c')
-rw-r--r--src/common/string.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/string.c b/src/common/string.c
index b2ec309..120fd5d 100644
--- a/src/common/string.c
+++ b/src/common/string.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include <stdlib.h>
+#include <stdlib_common.h>
int strlen(const char *str) {
int i = 0;
@@ -63,10 +63,11 @@ void *memcpy(void *vd, const void *vs, int count) {
return vd;
}
-uint8_t *memset(uint8_t *dest, uint8_t val, int count) {
+void *memset(void *dest, int val, int count) {
+ uint8_t *dest_c = (uint8_t*)dest;
int i;
for (i = 0; i < count; i++) {
- dest[i] = val;
+ dest_c[i] = val;
}
return dest;
}