Skip to content

Fetch method result #1

@dagothzero

Description

@dagothzero

Hi!, I've tried this library, but frequently it doesn't work. (Example: memory efficient deduplication for files). I'm using Linux Mint 20.3 (x64).
I think it's because the Fetch method, FirstKey, and NextKey don't come with the last null character in the returned string.
The original c language gdbm, either store it with last '\0', or look at dsize and copy it somewhere. Maybe it doesn't have to be a string.

if vdatum.dptr == nil:
    result = ""
else:
    result = newString(vdatum.dsize)
    copyMem(result[0].addr, vdatum.dptr, vdatum.dsize)

This will work always...

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