miere43 / nim-registry

Deal with Windows Registry from Nim
http://miere.ru/docs/registry/
MIT License
29 stars 5 forks source link

Bugs in enumSubkeys and readString #2

Closed jdmansour closed 8 years ago

jdmansour commented 8 years ago

Hi, while playing around with this nice package I found two bugs. One is that enumSubkeys would repeatedly return the same string, unless the next subkey was shorter. I fixed it by resetting numCharsReaded before every call regEnumKeyEx. I also reordered the function a bit and used case.

The other one was in readString, which raised an exception due to ERROR_MORE_DATA. There was a superfluous line and this case was not handled.

Hope it is OK that I put these different commits together in one pull request, this is my first pull request on GitHub :-).

miere43 commented 8 years ago

Yay, that's neat and seems good. Thanks a lot!