Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion EDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ EDB_Status EDB::open(unsigned long head_ptr)
// Thanks to Steve Kelly for the next line...
EDB_table_ptr = sizeof(EDB_Header) + EDB_head_ptr; // this line was originally missing in the downloaded library
readHead();
return EDB_OK;
return (EDB_head.flag == EDB_FLAG ? EDB_OK : EDB_ERROR);
}

// writes a record to a given recno
Expand Down Expand Up @@ -172,6 +172,9 @@ unsigned long EDB::count()
// returns the maximum number of items that will fit into the queue
unsigned long EDB::limit()
{

// in case of currept db, the record len could be a zero
if ( EDB_head.rec_size == 0 ) return 0;
// Thanks to oleh.sok...@gmail.com for the next line
return (EDB_head.table_size - sizeof(EDB_Header)) / EDB_head.rec_size;
}
Expand Down