X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ED2KLink.cpp;h=6ddcdc4b38646269e9c9da27b439430c689ac07f;hb=ee4c05de3061d1d7abfd1710823442cbc0cfbf46;hp=f8e7373dc6d9a728b41363b73048420cb6500519;hpb=e7c26721f55730f25f7be2ab297e65d4e8598872;p=ecparse.git diff --git a/ED2KLink.cpp b/ED2KLink.cpp index f8e7373..6ddcdc4 100644 --- a/ED2KLink.cpp +++ b/ED2KLink.cpp @@ -56,9 +56,10 @@ ED2KLink* ED2KLink::parseED2KLink(const char* buffer) { char* pipeIndex; int stringLength; - GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] trying to parse “%s”...\n", __FILE__, __LINE__, buffer); + GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] trying to parse “%s”...\n", __FILE__, __LINE__, tempBuffer); - if (strncmp("ed2k://|file|", buffer, 13)) { + if (strncmp("ed2k://|file|", tempBuffer, 13)) { + GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] line does not start with “ed2k://|file|”!\n", __FILE__, __LINE__); return NULL; } @@ -71,7 +72,7 @@ ED2KLink* ED2KLink::parseED2KLink(const char* buffer) { stringLength = (char*) pipeIndex - tempBuffer; filename = (char*) malloc(stringLength + 1); memcpy(filename, tempBuffer, stringLength); - sizeString[stringLength] = '\0'; + filename[stringLength] = '\0'; tempBuffer = pipeIndex + 1; GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] parsed filename: “%s”.\n", __FILE__, __LINE__, filename);