Skip to content
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

WiFiUDP.parseInt - Infinite Loop/WDT Reset - V2.2.0 (See #1796) #1946

Closed
AllanMar opened this issue Apr 20, 2016 · 0 comments
Closed

WiFiUDP.parseInt - Infinite Loop/WDT Reset - V2.2.0 (See #1796) #1946

AllanMar opened this issue Apr 20, 2016 · 0 comments

Comments

@AllanMar
Copy link

AllanMar commented Apr 20, 2016

It appears as though the fix for #1796 did not solve the issue.
I couldn't understand originally why, as it appears to just be a different method of doing what I had suggested.

Upon further investigation the issue is here:

char peek()
    {
        if (!_rx_buf || _rx_buf_offset == _rx_buf->len)
            return -1;

        return reinterpret_cast<char*>(_rx_buf->payload)[_rx_buf_offset];
    }

It appears in ESP8266 toolchain (like ARM, but unlike AVR) char defaults to UNSIGNED. Which means it never returns -1 and results in infinite loops elsewhere in the code (parseInt in this case).

  • Shouldn't peek be an int (consistent with read)?
  • Should ESP8266 Arduino use -fsigned-char to default chars to signed?
  • just define peek as signed char? (my current workaround)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants