Skip to content

bugs? #3

@jsrffd2

Description

@jsrffd2

Hi
I think there are two bugs in the code:

  1. when you perform the open of the file (line 243)
    cdb_ = fs_.open(fileName);
    should be
    cdb_ = fs_.open(fileName,"r");

  2. in case the database contains few records the hashTabSlotsNum_ at line 331 becomes equal to 0 if the searched key is not present so the division at line 336 takes a fault.
    As fix probably is better to add the following statement after line 334

  if (hashTabSlotsNum_ == 0) {
    return (state_ = KEY_NOT_FOUND);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions