ExternalBytes.st
branchjv
changeset 17742 3fef0ed4c2d5
parent 17728 bbc5fa73dfab
child 17756 f4d72b8d0d89
--- a/ExternalBytes.st	Sun Dec 27 19:45:23 2009 +0000
+++ b/ExternalBytes.st	Sun Dec 27 20:16:54 2009 +0000
@@ -779,13 +779,15 @@
 !ExternalBytes methodsFor:'compatibility-VW'!
 
 copyCStringFromHeap
-    |s|
+    |idx byte s|
 
-    s := String new:(self indexOf:0)-1.
-    1 to:s size do:[:idx |
-	s at:idx put:(Character value:(self at:idx))
+    idx := 1.
+    s := WriteStream on:String new.
+    [(byte := self at:idx) ~~ 0] whileTrue:[
+        s nextPut:(Character value:byte).
+        idx := idx + 1.
     ].
-    ^ s.
+    ^ s contents asString
 ! !
 
 !ExternalBytes methodsFor:'converting'!
@@ -1303,7 +1305,12 @@
 !ExternalBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ExternalBytes.st 10467 2009-08-19 16:14:36Z vranyj1 $'
+    ^ '$Id: ExternalBytes.st 10489 2009-12-27 20:16:54Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.75 2009/12/07 15:57:59 cg Exp §'
 ! !
 
 ExternalBytes initialize!
+