Skip to content

Commit

Permalink
Fix cbuf::read and cbuf::peak return types
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
igrr committed Mar 29, 2015
1 parent d2c9354 commit d703131
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cores/esp8266/cbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ class cbuf
return _begin == _end;
}

char peek()
int peek()
{
if (_end == _begin)
return -1;

return *_begin;
return static_cast<int>(*_begin);
}

char read()
int read()
{
if (getSize() == 0)
return -1;

char result = *_begin;
if (++_begin == _bufend)
_begin = _buf;
return result;
return static_cast<int>(result);
}

size_t read(char* dst, size_t size)
Expand Down

0 comments on commit d703131

Please sign in to comment.