-
Notifications
You must be signed in to change notification settings - Fork 21
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
handle safe-string #47
Conversation
sha1_stubs.c
Outdated
@@ -154,7 +154,7 @@ CAMLprim value stub_sha1_to_bin(value digest) | |||
CAMLlocal1(result); | |||
|
|||
result = caml_alloc_string(20); | |||
sha1_to_bin((sha1_digest *) digest, String_val(result)); | |||
sha1_to_bin((sha1_digest *) digest, &Byte(String_val(result), 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner to use Bytes_val(result)
.
This macro is available since 4.06+, is such new dependency constraint intended?
A number of projects just add a compat define.
Not sure if snprintf can cope with unsigned char as input.
|
OK, then you can use |
String_val() will return 'const char *'. Signed-off-by: Olaf Hering <olaf@aepfle.de>
I have updated the change. |
Any idea if this MR is acceptable now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes look good, but it is up to the maintainer to merge it. cc @djs55 |
Thanks for the ping and the PR! Looks fine to me. |
CHANGES: - Handle `safe-string` by @olafhering, reviewed by @nojb (djs55/ocaml-sha#47) - Remove `--dev` option from `dune` invocation by @arthurteisseire (djs55/ocaml-sha#48)
String_val() will return 'const char *'.
Signed-off-by: Olaf Hering olaf@aepfle.de