glib-log test: copy nul terminator

The classic C bug, possible in Racket thanks to `ffi/unsafe`.
This commit is contained in:
Matthew Flatt 2016-12-23 15:15:18 -07:00
parent 710320e3dc
commit a5af8708dd

View File

@ -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"))