We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ethereum-api/provableAPI_0.6.sol
Line 1041 in 9f34daa
Hi
I have few revert issues when I tried to format 1 digit numbers (1 ,2 ,3..Etc) .
uint k = len - 1; --> length is 1 and k is 0
uint k = len - 1;
bstr[k--] = byte(uint8(48 + _i % 10)); underflows as k is unsigned so 0-1 = -1
bstr[k--] = byte(uint8(48 + _i % 10));
suggestion to have something like this. "k" starts with 1 and is decremented before operation
uint k = len ; while (_i != 0) { bstr[--k] = bytes1(uint8(48 + _i % 10)); _i /= 10; } return string(bstr);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ethereum-api/provableAPI_0.6.sol
Line 1041 in 9f34daa
Hi
I have few revert issues when I tried to format 1 digit numbers (1 ,2 ,3..Etc) .
uint k = len - 1;
--> length is 1 and k is 0bstr[k--] = byte(uint8(48 + _i % 10));
underflows as k is unsigned so 0-1 = -1suggestion to have something like this. "k" starts with 1 and is decremented before operation
The text was updated successfully, but these errors were encountered: