From bcacad7629ef45dc32e11096a43be74b081d2817 Mon Sep 17 00:00:00 2001 From: Sergey Semushin Date: Sat, 18 May 2019 18:03:51 +0300 Subject: [PATCH] Prettify codec_get_encoded_len. --- Source/codec.cpp | 6 +++--- Source/codec.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/codec.cpp b/Source/codec.cpp index 8e0882eb7..7977720cd 100644 --- a/Source/codec.cpp +++ b/Source/codec.cpp @@ -80,10 +80,10 @@ void codec_init_key(int unused, char *pszPassword) // 4035DB: using guessed type char var_58[64]; // 4035DB: using guessed type char dst[20]; -int codec_get_encoded_len(int dwSrcBytes) +DWORD codec_get_encoded_len(DWORD dwSrcBytes) { - if (dwSrcBytes & 0x3F) - dwSrcBytes += 64 - (dwSrcBytes & 0x3F); + if (dwSrcBytes % 64 != 0) + dwSrcBytes += 64 - (dwSrcBytes % 64); return dwSrcBytes + 8; } diff --git a/Source/codec.h b/Source/codec.h index 0df61c1e8..c801e0a9e 100644 --- a/Source/codec.h +++ b/Source/codec.h @@ -4,7 +4,7 @@ int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword); void codec_init_key(int unused, char *pszPassword); -int codec_get_encoded_len(int dwSrcBytes); +DWORD codec_get_encoded_len(DWORD dwSrcBytes); void codec_encode(void *pbSrcDst, int size, int size_64, char *pszPassword); #endif /* __CODEC_H__ */