aboutsummaryrefslogtreecommitdiff
path: root/gosthash.c
diff options
context:
space:
mode:
authorNikolay Morozov <nmorozoff77@yandex.ru>2020-02-26 12:38:27 +0300
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>2020-02-27 00:14:48 +0300
commit0906436e33bdd8dabf07d494e3d6d5184cc02246 (patch)
treeec09bd8099b325e525132588d9f16c4310e0d575 /gosthash.c
parent2883c9c20b26688f648fc14db1637890f96cab35 (diff)
downloadgost-engine-0906436e33bdd8dabf07d494e3d6d5184cc02246.zip
gost-engine-0906436e33bdd8dabf07d494e3d6d5184cc02246.tar.gz
gost-engine-0906436e33bdd8dabf07d494e3d6d5184cc02246.tar.bz2
cppcheck: The scope of the variable can be reduced.
Diffstat (limited to 'gosthash.c')
-rw-r--r--gosthash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gosthash.c b/gosthash.c
index 036a2b3..7fd3cb0 100644
--- a/gosthash.c
+++ b/gosthash.c
@@ -65,9 +65,8 @@ static int add_blocks(int n, byte * left, const byte * right)
{
int i;
int carry = 0;
- int sum;
for (i = 0; i < n; i++) {
- sum = (int)left[i] + (int)right[i] + carry;
+ int sum = (int)left[i] + (int)right[i] + carry;
left[i] = sum & 0xff;
carry = sum >> 8;
}