diff --git a/src/str.c b/src/str.c index 02087dd..1709625 100644 --- a/src/str.c +++ b/src/str.c @@ -187,7 +187,7 @@ char *my_strdup(const char *s) { while( s[count] ) ++count; ++count; - out = malloc(sizeof(char*) * count); + out = malloc(sizeof(char) * count); out[--count] = 0; while( --count >= 0 ) out[count] = s[count]; @@ -200,7 +200,7 @@ char *my_strndup(const char *s, int n) { while( count < n && s[count] ) ++count; ++count; - out = malloc(sizeof(char*) * count); + out = malloc(sizeof(char) * count); out[--count] = 0; while( --count >= 0 ) out[count] = s[count];