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

bugs? #3

Open
jsrffd2 opened this issue Feb 10, 2024 · 0 comments
Open

bugs? #3

jsrffd2 opened this issue Feb 10, 2024 · 0 comments

Comments

@jsrffd2
Copy link

jsrffd2 commented Feb 10, 2024

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);
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant