X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fstrings.lisp;h=430d8ab48d15c1b29c988108570867b41e487b89;hb=a63da5b764b6fa30e32fcda4ddac88de385c9d5b;hp=4f2eae3c7e430456dd4355b8462fddedefe58eba;hpb=ffdc4f04a2775d3df75088de0d50134c23917e5c;p=uffi.git diff --git a/src/strings.lisp b/src/strings.lisp index 4f2eae3..430d8ab 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -394,12 +394,12 @@ that LW/CMU automatically converts strings from c-calls." ) (defun foreign-string-length (foreign-string) - #+allegro `(ff:foreign-strlen ,foreign-string) + #+allegro (ff:foreign-strlen foreign-string) #-allegro - `(loop - for size from 0 - until (char= (deref-array ,foreign-string '(:array :unsigned-char) size) #\Null) - finally (return size))) + (loop + for size from 0 + until (zerop (deref-array foreign-string '(:array :unsigned-char) size)) + finally (return size))) (defmacro with-foreign-string ((foreign-string lisp-string &optional encoding)