Skip to content

Commit 33513d1

Browse files
realleseeAmxx
andauthored
Explicit Initialization of Loop Counter in escapeJSON Function (#5796)
Co-authored-by: Hadrien Croubois <[email protected]>
1 parent 337211c commit 33513d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/utils/Strings.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ library Strings {
465465
bytes memory output = new bytes(2 * buffer.length); // worst case scenario
466466
uint256 outputLength = 0;
467467

468-
for (uint256 i; i < buffer.length; ++i) {
468+
for (uint256 i = 0; i < buffer.length; ++i) {
469469
bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));
470470
if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {
471471
output[outputLength++] = "\\";

0 commit comments

Comments
 (0)