From a63da5b764b6fa30e32fcda4ddac88de385c9d5b Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 20 Dec 2011 20:02:40 -0700 Subject: [PATCH] Fix comparison for dereference --- debian/changelog | 6 ++++++ src/strings.lisp | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index b8f4452..f966a32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (2.1.2-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Tue, 20 Dec 2011 20:01:37 -0700 + cl-uffi (2.1.1-1) unstable; urgency=low * New upstream diff --git a/src/strings.lisp b/src/strings.lisp index 834d251..430d8ab 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -393,13 +393,13 @@ that LW/CMU automatically converts strings from c-calls." `(new-ptr ,size) ) -(defmacro foreign-string-length (foreign-string) - #+allegro `(ff:foreign-strlen ,foreign-string) +(defun foreign-string-length (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) -- 2.34.1