-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
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
Fixed libb64 decoder. #2883
Fixed libb64 decoder. #2883
Conversation
Libb64 decoder works when "char" type is signed. In esp8266 xtensa gcc "char" is unsigned, so libb64 decoder does not work. In the implementation file I replaced "char" to "int8_t" and created function wrappers in order to keep existing interface.
Current coverage is 27.80% (diff: 100%)@@ master #2883 diff @@
==========================================
Files 20 20
Lines 3625 3625
Methods 335 335
Messages 0 0
Branches 656 656
==========================================
Hits 1008 1008
Misses 2441 2441
Partials 176 176
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this, just one minor note regarding indentation consistency.
|
||
int base64_decode_value(char value_in) | ||
{ | ||
return base64_decode_value_signed(*((int8_t *) &value_in)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest of the file doesn't seem to use tabs for indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry for this.
Implements: esp8266/Arduino#2883 Fixes: #313 Fixes: #344
Implements: esp8266/Arduino#2883 Fixes: espressif/arduino-esp32#313 Fixes: espressif/arduino-esp32#344
Libb64 decoder works when "char" type is signed. In esp8266 xtensa gcc "char" is unsigned, so libb64 decoder does not work. In the implementation file I replaced "char" to "int8_t" and created function wrappers in order to keep existing interface.
I tested it, it works!