Fix sagittarius string->pointer
This commit is contained in:
parent
6d15fb2c2b
commit
8a3edd88d8
|
|
@ -85,20 +85,6 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(empty-pointer)))
|
(empty-pointer)))
|
||||||
|
|
||||||
(define pffi-string->pointer
|
|
||||||
(lambda (string-content)
|
|
||||||
(letrec* ((bytes (string->utf8 string-content))
|
|
||||||
(bytes-length (bytevector-length bytes))
|
|
||||||
(pointer-length (+ bytes-length 1))
|
|
||||||
(pointer (pffi-pointer-allocate pointer-length))
|
|
||||||
(looper
|
|
||||||
(lambda (index)
|
|
||||||
(when (< index bytes-length)
|
|
||||||
(pointer-set-c-uint8_t! pointer index (bytevector-u8-ref bytes index))
|
|
||||||
(looper (+ index 1))))))
|
|
||||||
(looper 0)
|
|
||||||
pointer)))
|
|
||||||
|
|
||||||
(define pffi-string->pointer
|
(define pffi-string->pointer
|
||||||
(lambda (string-content)
|
(lambda (string-content)
|
||||||
string-content))
|
string-content))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue