Skip to content

Commit

Permalink
fix for null
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Sep 27, 2024
1 parent 7db34da commit 4523298
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/async-process.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@
(%process-send-input (process-process process) string)))

(defun pointer-to-string (pointer)
(let ((bytes (loop :for i :from 0
:for code := (cffi:mem-aref pointer :unsigned-char i)
:until (zerop code)
:collect code)))
(map 'string 'code-char bytes)))
(unless (cffi:null-pointer-p pointer)
(let ((bytes (loop :for i :from 0
:for code := (cffi:mem-aref pointer :unsigned-char i)
:until (zerop code)
:collect code)))
(map 'string 'code-char bytes))))

(defun process-receive-output (process)
(let ((cffi:*default-foreign-encoding* (process-encode process)))
Expand Down

0 comments on commit 4523298

Please sign in to comment.