mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-17 09:43:20 +00:00
fix: use unsafeAddr for string-to-ptr cast in FFI callback
Part of https://github.com/logos-storage/logos-storage-nim/issues/1366 Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
This commit is contained in:
parent
03aa6c5890
commit
6c877f3aad
@ -19,7 +19,7 @@ const RET_PROGRESS*: cint = 3
|
||||
## Returns RET_OK as acknowledgment and call the callback
|
||||
## with RET_OK code and the provided message.
|
||||
proc success*(callback: StorageCallback, msg: string, userData: pointer): cint =
|
||||
callback(RET_OK, cast[ptr cchar](msg), cast[csize_t](len(msg)), userData)
|
||||
callback(RET_OK, unsafeAddr msg[0], cast[csize_t](len(msg)), userData)
|
||||
|
||||
return RET_OK
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user