Skip to content

Commit

Permalink
fixing EOF issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
sovcik committed Nov 3, 2018
1 parent a4063c1 commit 12b3660
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LogBufferSPIFFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ int LogBufferSPIFFS::read(LogRecord *rec){
size_t recSize = sizeof(*rec);

_logFile.seek(_rfilepos, SeekSet);
if (!_noNewRecords && _circular && _logFile.available() >= recSize && _logFile.size() > 0){
//DEBUG_PRINT("*[lbSPF:read] nr=%d, cir=%d, avail=%lu, size=%lu\n",_noNewRecords, _circular, _logFile.available(), _logFile.size());
if (!_noNewRecords && _circular && _logFile.size() > 0){
_rfilepos = seekNext(MARK_NEW, 1);
if (!_logFile.available()){ // reached end trying to find next NEW record
_noNewRecords = 1;
Expand Down

0 comments on commit 12b3660

Please sign in to comment.