Skip to content

Commit 4523298

Browse files
committed
fix for null
1 parent 7db34da commit 4523298

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/async-process.lisp

+6-5
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@
9494
(%process-send-input (process-process process) string)))
9595

9696
(defun pointer-to-string (pointer)
97-
(let ((bytes (loop :for i :from 0
98-
:for code := (cffi:mem-aref pointer :unsigned-char i)
99-
:until (zerop code)
100-
:collect code)))
101-
(map 'string 'code-char bytes)))
97+
(unless (cffi:null-pointer-p pointer)
98+
(let ((bytes (loop :for i :from 0
99+
:for code := (cffi:mem-aref pointer :unsigned-char i)
100+
:until (zerop code)
101+
:collect code)))
102+
(map 'string 'code-char bytes))))
102103

103104
(defun process-receive-output (process)
104105
(let ((cffi:*default-foreign-encoding* (process-encode process)))

0 commit comments

Comments
 (0)