From: David ‘Bombe’ Roden Date: Sat, 5 Jul 2008 20:54:11 +0000 (+0200) Subject: make length calculation more obvious X-Git-Tag: 0.1~19 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e7c26721f55730f25f7be2ab297e65d4e8598872;p=ecparse.git make length calculation more obvious --- diff --git a/ED2KLink.cpp b/ED2KLink.cpp index 74a38c9..f8e7373 100644 --- a/ED2KLink.cpp +++ b/ED2KLink.cpp @@ -25,7 +25,7 @@ ED2KLink::ED2KLink(const char* filename, const size_t size, const void* hash) { memcpy(this->hash, hash, 16); this->size = size; - link = (char*) calloc(13 + (strlen(filename) + 1) + 1 + getDigits(size) + 1 + 32 + 2, 1); + link = (char*) calloc(13 + strlen(filename) + 1 + getDigits(size) + 1 + 32 + 2 + 1, 1); sprintf(link, "ed2k://|file|%s|%u|", filename, size); for (int i = 0; i < 16; i++) { sprintf(link + strlen(link), "%02X", ((unsigned char*) hash)[i] & 0xff);