From 9842b92bd1534c0fb6053213b1ac9f1cde1a117c Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 21 Feb 2024 13:50:51 +0100 Subject: [PATCH] src/actions/transformations/hex_decode.cc: reduce the scope of variable in a for () loop In general, it is always preferable to reduce the scope of a variable in a for loop --- src/actions/transformations/hex_decode.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/transformations/hex_decode.cc b/src/actions/transformations/hex_decode.cc index e626bc5f..1525377c 100644 --- a/src/actions/transformations/hex_decode.cc +++ b/src/actions/transformations/hex_decode.cc @@ -58,13 +58,13 @@ std::string HexDecode::evaluate(const std::string &value, int HexDecode::inplace(unsigned char *data, int len) { unsigned char *d = data; - int i, count = 0; + int count = 0; if ((data == NULL) || (len == 0)) { return 0; } - for (i = 0; i <= len - 2; i += 2) { + for (int i = 0;i <= len - 2;i += 2) { *d++ = utils::string::x2c(&data[i]); count++; }