From 12f4fa44b85ba314da84d680046362f8484c0e1c Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 2 Nov 2020 05:11:54 +0100 Subject: [PATCH] Add const in codec.cpp --- Source/codec.cpp | 6 +++--- Source/codec.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/codec.cpp b/Source/codec.cpp index 3b232c6b9..b7698145b 100644 --- a/Source/codec.cpp +++ b/Source/codec.cpp @@ -14,7 +14,7 @@ typedef struct CodecSignature { #define BLOCKSIZE 64 -static void codec_init_key(int unused, char *pszPassword) +static void codec_init_key(int unused, const char *pszPassword) { int i, ch, n; char key[136]; // last 64 bytes are the SHA1 @@ -50,7 +50,7 @@ static void codec_init_key(int unused, char *pszPassword) memset(key, 0, sizeof(key)); } -int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword) +int codec_decode(BYTE *pbSrcDst, DWORD size, const char *pszPassword) { char buf[128]; char dst[SHA1HashSize]; @@ -101,7 +101,7 @@ DWORD codec_get_encoded_len(DWORD dwSrcBytes) return dwSrcBytes + sizeof(CodecSignature); } -void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) +void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPassword) { char buf[128]; char tmp[SHA1HashSize]; diff --git a/Source/codec.h b/Source/codec.h index 4a3175783..2325500a8 100644 --- a/Source/codec.h +++ b/Source/codec.h @@ -6,8 +6,8 @@ #ifndef __CODEC_H__ #define __CODEC_H__ -int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword); +int codec_decode(BYTE *pbSrcDst, DWORD size, const char *pszPassword); DWORD codec_get_encoded_len(DWORD dwSrcBytes); -void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword); +void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPassword); #endif /* __CODEC_H__ */