From a0eb955ae6aa166e2c54bcbdd2521d75264fd3ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 5 Jul 2008 22:49:25 +0200 Subject: [PATCH] reserve enough memory --- ED2KLink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ED2KLink.cpp b/ED2KLink.cpp index 5f33ce8..74a38c9 100644 --- a/ED2KLink.cpp +++ b/ED2KLink.cpp @@ -18,7 +18,7 @@ static int getDigits(size_t number) { } ED2KLink::ED2KLink(const char* filename, const size_t size, const void* hash) { - this->filename = (char*) malloc(strlen(filename)); + this->filename = (char*) malloc(strlen(filename) + 1); this->hash = malloc(16); strcpy(this->filename, filename); -- 2.7.4