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
for(int i=0; i<100; i++) { ParseResult result = parseWithResult(0, aBuf, offset, aLen-offset); tlvs.add(result.tlv);
if(result.offset>=aOffset+aLen) { break; } offset = result.offset;
}
i think that code is better
int curOffset; do { ParseResult result = parseWithResult(0, aBuf, offset, aLen-offset); tlvs.add(result.tlv);
if(result.offset>=aOffset+aLen) { break; } curOffset = result.offset; offset = result.offset;
} while (curOffset<aOffset+aLen);
The text was updated successfully, but these errors were encountered:
Wondering about this also - is this just to avoid very long parses? That magic number of 100 does not really make sense.
Sorry, something went wrong.
simple:
int offset = aOffset; do { final ParseResult result = parseWithResult(0, aBuf, offset, aLen-offset); tlvs.add(result.tlv); offset = result.offset; } while(offset < aOffset+aLen);
passes all the tests
it's usually about not having unbound loops on possibly unverified input.
fair point. But this could be left as a setting
No branches or pull requests
for(int i=0; i<100; i++) {
ParseResult result = parseWithResult(0, aBuf, offset, aLen-offset);
tlvs.add(result.tlv);
}
i think that code is better
int curOffset;
do {
ParseResult result = parseWithResult(0, aBuf, offset, aLen-offset);
tlvs.add(result.tlv);
} while (curOffset<aOffset+aLen);
The text was updated successfully, but these errors were encountered: