diff options
-rw-r--r-- | kftpgrabber/src/engine/ftpdirectoryparser.cpp | 2 | ||||
-rw-r--r-- | kftpgrabber/src/engine/ftpdirectoryparser.h | 2 | ||||
-rw-r--r-- | kftpgrabber/src/misc/desencryptor.cpp | 26 |
3 files changed, 15 insertions, 15 deletions
diff --git a/kftpgrabber/src/engine/ftpdirectoryparser.cpp b/kftpgrabber/src/engine/ftpdirectoryparser.cpp index 981d0b6..18b22a7 100644 --- a/kftpgrabber/src/engine/ftpdirectoryparser.cpp +++ b/kftpgrabber/src/engine/ftpdirectoryparser.cpp @@ -400,7 +400,7 @@ bool FtpDirectoryParser::parseMlsd(const TQString &line, DirectoryEntry &entry) return true; } -bool FtpDirectoryParser::parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry) +void FtpDirectoryParser::parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry) { int p = 0; diff --git a/kftpgrabber/src/engine/ftpdirectoryparser.h b/kftpgrabber/src/engine/ftpdirectoryparser.h index 0c02fa0..5c99960 100644 --- a/kftpgrabber/src/engine/ftpdirectoryparser.h +++ b/kftpgrabber/src/engine/ftpdirectoryparser.h @@ -84,7 +84,7 @@ private: bool parseComplexFileSize(DToken &token, filesize_t &size); - bool parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry); + void parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry); }; } diff --git a/kftpgrabber/src/misc/desencryptor.cpp b/kftpgrabber/src/misc/desencryptor.cpp index a66a5ef..0ddad36 100644 --- a/kftpgrabber/src/misc/desencryptor.cpp +++ b/kftpgrabber/src/misc/desencryptor.cpp @@ -61,27 +61,27 @@ void DESEncryptor::DESExec(const TQString &str, int mode) memcpy(in.data(), string.data(), in.size()); } - // Read 8 chars at a time and encrypt/decrypt them + // Read sizeof(DES_cblock) chars at a time and encrypt/decrypt them unsigned int i = 0; - char *o_message = (char*) malloc(8); - char *o_output = (char*) malloc(8); + DES_cblock *o_message = (DES_cblock*) malloc(sizeof(DES_cblock)); + DES_cblock *o_output = (DES_cblock*) malloc(sizeof(DES_cblock)); - memset(o_message, 0, 9); - memset(o_output, 0, 9); + memset(o_message, 0, sizeof(DES_cblock)); + memset(o_output, 0, sizeof(DES_cblock)); //out.resize(in.size() * 2); while (i < in.size()) { - out.resize(out.size() + 8); - memcpy(o_message, in.data() + i, 8); - DES_ecb_encrypt((DES_cblock *) o_message, (DES_cblock*) o_output, &m_schedule, mode); - memcpy(out.data() + i, o_output, 8); + out.resize(out.size() + sizeof(DES_cblock)); + memcpy(o_message, in.data() + i, sizeof(DES_cblock)); + DES_ecb_encrypt(o_message, o_output, &m_schedule, mode); + memcpy(out.data() + i, o_output, sizeof(DES_cblock)); - // Next 8 bytes - i += 8; + // Next sizeof(DES_cblock) bytes + i += sizeof(DES_cblock); // Clear everything - memset(o_message, 0, 9); - memset(o_output, 0, 9); + memset(o_message, 0, sizeof(DES_cblock)); + memset(o_output, 0, sizeof(DES_cblock)); } free(o_message); |