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
In cstr.cpp inside of the for loop you index your hexTo_StringOutput with a negative index when i goes past 7.
hexTo_StringOutput
i
This can be fixed like so:
char hexTo_StringOutput[128]; const char* to_hstring(uint64_t value){ uint64_t* valPtr = &value; uint8_t* ptr; uint8_t tmp; uint8_t size = 8 * 2 - 1; - for (uint8_t i = 0; i < size; i++){ + for (uint8_t i = 0; i < size / 2 + 1; i++){ ptr = ((uint8_t*)valPtr + i); tmp = ((*ptr & 0xF0) >> 4); hexTo_StringOutput[size - (i * 2 + 1)] = tmp + (tmp > 9 ? 55 : '0'); tmp = ((*ptr & 0x0F)); hexTo_StringOutput[size - (i * 2)] = tmp + (tmp > 9 ? 55 : '0'); } hexTo_StringOutput[size + 1] = 0; return hexTo_StringOutput; }
I am willing to pr this change if you want, but I'm not sure if you want it to be pulled into all branches since episode 4 or not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In cstr.cpp inside of the for loop you index your
hexTo_StringOutput
with a negative index wheni
goes past 7.This can be fixed like so:
I am willing to pr this change if you want, but I'm not sure if you want it to be pulled into all branches since episode 4 or not.
The text was updated successfully, but these errors were encountered: