small bugs.
This commit is contained in:
+11
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user