Skip to content

Use FFI::MemoryPointer from_string for Ssdeep.from_string#1

Open
pachoo wants to merge 1 commit intoemonti:masterfrom
pachoo:patch-1
Open

Use FFI::MemoryPointer from_string for Ssdeep.from_string#1
pachoo wants to merge 1 commit intoemonti:masterfrom
pachoo:patch-1

Conversation

@pachoo
Copy link
Copy Markdown

@pachoo pachoo commented Mar 31, 2014

Previously this code was using the string's size in characters NOT its size in bytes to determine how many bytes to copy into buf. By using the FFI::MemoryPointer.from_string method this takes care of string encoding so that all of the string's bytes are copied.

Previously this code was using the string's size in characters NOT its size in bytes to determine how many bytes to copy into buf.  By using the FFI::MemoryPointer.from_string method this takes care of string encoding so that all of the string's bytes are copied.
@emonti
Copy link
Copy Markdown
Owner

emonti commented Mar 31, 2014

Looks like this is actually what you want here:

dd96e9

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

Successfully merging this pull request may close these issues.

2 participants