projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix comparison for dereference
[uffi.git]
/
src
/
strings.lisp
diff --git
a/src/strings.lisp
b/src/strings.lisp
index 834d251b2620ffc09888dfdb98507fc2924e42b6..430d8ab48d15c1b29c988108570867b41e487b89 100644
(file)
--- a/
src/strings.lisp
+++ b/
src/strings.lisp
@@
-393,13
+393,13
@@
that LW/CMU automatically converts strings from c-calls."
`(new-ptr ,size)
)
`(new-ptr ,size)
)
-(def
macro
foreign-string-length (foreign-string)
- #+allegro
`(ff:foreign-strlen ,
foreign-string)
+(def
un
foreign-string-length (foreign-string)
+ #+allegro
(ff:foreign-strlen
foreign-string)
#-allegro
#-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)
(defmacro with-foreign-string ((foreign-string lisp-string &optional encoding)