diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-03-16 00:39:47 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-03-16 00:39:47 +0900 |
commit | dde77f0a9a5797b530fdeeb53bf6e13ec2673282 (patch) | |
tree | bd774eba1873f049c8414043430c630f80e52821 | |
parent | b8223a491738ecbff4ba07df6fb88307b0b9158c (diff) | |
download | kftpgrabber-dde77f0a9a5797b530fdeeb53bf6e13ec2673282.tar.gz kftpgrabber-dde77f0a9a5797b530fdeeb53bf6e13ec2673282.zip |
Fixed lint messages related to bug 2409.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-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); |