glib-log test: copy nul terminator
The classic C bug, possible in Racket thanks to `ffi/unsafe`.
This commit is contained in:
parent
710320e3dc
commit
a5af8708dd
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
(define (make s)
|
(define (make s)
|
||||||
(define p (malloc (add1 (bytes-length s)) 'raw))
|
(define p (malloc (add1 (bytes-length s)) 'raw))
|
||||||
(memcpy p s (bytes-length s))
|
(memcpy p s (add1 (bytes-length s)))
|
||||||
p)
|
p)
|
||||||
|
|
||||||
(define hello (make #"hello"))
|
(define hello (make #"hello"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user