提交 5e79bf7c 编写于 作者: E Emmanuel Leblond

Merge pull request #52 from eworm-de/malloc

allocate memory for string termination
......@@ -66,7 +66,7 @@ static const char * strlwc(const char * in, char *out, unsigned len)
/*--------------------------------------------------------------------------*/
static char * _strdup(const char *s)
{
char * copy = (char*) malloc(strlen(s));
char * copy = (char*) malloc(strlen(s) + 1);
strcpy(copy, s);
return copy ;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册