mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
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
This commit is contained in:
parent
734646dbf1
commit
9842b92bd1
@ -58,13 +58,13 @@ std::string HexDecode::evaluate(const std::string &value,
|
|||||||
|
|
||||||
int HexDecode::inplace(unsigned char *data, int len) {
|
int HexDecode::inplace(unsigned char *data, int len) {
|
||||||
unsigned char *d = data;
|
unsigned char *d = data;
|
||||||
int i, count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if ((data == NULL) || (len == 0)) {
|
if ((data == NULL) || (len == 0)) {
|
||||||
return 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]);
|
*d++ = utils::string::x2c(&data[i]);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user