summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-24 16:28:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-24 16:28:56 +0300
commitee0982bc1b86b8a2c79306ac394eeaad59ed3a80 (patch)
tree65915ee413c909fdbedfc6440cfa88b593f5f0c7 /protocols
parent5d6f635daaf77f7c75218f8d61ed0b63da36402f (diff)
fix for buffer padding
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/utils.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp
index b2fce4db09..05e9d2c3bc 100644
--- a/protocols/WhatsApp/src/utils.cpp
+++ b/protocols/WhatsApp/src/utils.cpp
@@ -296,9 +296,7 @@ void generateIV(uint8_t *iv, uint32_t &pVar)
void padBuffer16(MBinBuffer &buf)
{
- uint8_t c = buf.length() % 16;
- if (c == 0)
- c = 16;
+ uint8_t c = 16 - buf.length() % 16;
for (uint8_t i = 0; i < c; i++)
buf.append(&c, 1);