small bugs.

This commit is contained in:
2026-06-10 02:30:23 +02:00
parent 0b5d8a21b4
commit 815f39a8cc
4 changed files with 121 additions and 98 deletions
+11 -1
View File
@@ -263,8 +263,18 @@
(when nul? (ptr-set! ptr _byte len 0))
ptr)
(define (string/bytes->malloc-cstring who v)
(define bs
(cond
[(bytes? v) v]
[(string? v) (string->bytes/utf-8 v)]
[(symbol? v) (string->bytes/utf-8 (symbol->string v))]
[(number? v) (string->bytes/utf-8 (number->string v))]
[else (raise-argument-error who "(or/c string? bytes? symbol? number?)" v)]))
(bytes->malloc-ptr bs #t))
(define (string->malloc-cstring s)
(bytes->malloc-ptr (string->bytes/utf-8 s) #t))
(string/bytes->malloc-cstring 'string->malloc-cstring s))
(define (picture->complex-property data size description mimetype picture-type)
(define data-ptr (bytes->malloc-ptr data #f))