Index: /trunk/ccl/examples/cocoa-editor.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-editor.lisp	(revision 5380)
+++ /trunk/ccl/examples/cocoa-editor.lisp	(revision 5381)
@@ -379,9 +379,9 @@
 		      (len (length chars)))
 		 (unless (zerop len)
-		   (%copy-ivector-to-ptr chars 0 bytes pos len)
+                   (%cstr-pointer chars (%inc-ptr bytes pos) nil)
 		   (incf pos len))
 		 (when next
-		   (setf (%get-byte bytes pos) (char-code #\return))
 		   (when cp/m-p
+                     (setf (%get-byte bytes pos) (char-code #\return))
 		     (incf pos)
 		   (setf (%get-byte bytes pos) (char-code #\linefeed))  
Index: /trunk/ccl/examples/cocoa-listener.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-listener.lisp	(revision 5380)
+++ /trunk/ccl/examples/cocoa-listener.lisp	(revision 5381)
@@ -113,7 +113,6 @@
 	   (data-length (send (the ns:ns-data data) 'length))
 	   (buffer (hemlock-document-buffer document))
-	   (string (make-string data-length))
+	   (string (%str-from-ptr (send data 'bytes) data-length))
 	   (fh filehandle))
-      (%copy-ptr-to-ivector (send data 'bytes) 0 string 0 data-length)
       (enqueue-buffer-operation
        buffer
@@ -155,5 +154,5 @@
          (bytes (send data 'mutable-bytes)))
     (declare (type ns:ns-file-handle filehandle))
-    (%copy-ivector-to-ptr string 0 bytes 0 len)
+    (%cstr-pointer string bytes nil)
     (send filehandle :write-data data)
     (send filehandle 'synchronize-file)))
