r9669: openmcl fix
[uffi.git] / src / strings.lisp
index f935e1bd479db0b479068a6e812432dbfebe44d9..c63d943e2c8e3496fb89056de87df03bb722bab1 100644 (file)
@@ -190,8 +190,9 @@ that LW/CMU automatically converts strings from c-calls."
   `(if (ccl:%null-ptr-p ,obj)
      nil
     #+(and mcl (not openmcl)) (ccl:%get-cstring ,obj 0 ,@(if length (list length) nil))
-    #+openmcl (let ((str (ccl:%get-cstring ,obj)))
-               ,(if length '(subseq str 0 length) 'str)))
+    #+openmcl ,@(if length
+                   `((ccl:%str-from-ptr ,obj ,length))
+                   `((ccl:%get-cstring ,obj))))
   )