Improving error messages

This commit is contained in:
retropikzel 2025-07-25 11:39:48 +03:00
parent 74c1f36b50
commit 939b2951a8
1 changed files with 5 additions and 4 deletions

View File

@ -77,10 +77,11 @@
(define-syntax c-utf8->string
(syntax-rules ()
((_ c-bytevector)
(when (c-null? c-bytevector)
(error "Can not turn null pointer into string" 'c-bytevector))
(let ((size (c-strlen c-bytevector)))
(utf8->string (c-bytevector->bytevector c-bytevector size))))))
(begin
(when (c-null? c-bytevector)
(error "Can not turn null pointer into string" 'c-bytevector))
(let ((size (c-strlen c-bytevector)))
(utf8->string (c-bytevector->bytevector c-bytevector size)))))))
(define string->c-utf8
(lambda (string-var)