2
0
Эх сурвалжийг харах

bugfix : writeBytes with len=0 write the full buffer

Nicolas Cannasse 13 жил өмнө
parent
commit
62c9fbcf38

+ 1 - 1
std/haxe/io/Bytes.hx

@@ -73,7 +73,7 @@ class Bytes {
 		b = untyped __php__("substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)"); //__call__("substr", b, 0, pos)+__call__("substr", src.b, srcpos, len)+__call__("substr", b, pos+len);
 		b = untyped __php__("substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)"); //__call__("substr", b, 0, pos)+__call__("substr", src.b, srcpos, len)+__call__("substr", b, pos+len);
 		#elseif flash9
 		#elseif flash9
 		b.position = pos;
 		b.position = pos;
-		b.writeBytes(src.b,srcpos,len);
+		if( len > 0 ) b.writeBytes(src.b,srcpos,len);
 		#else
 		#else
 		var b1 = b;
 		var b1 = b;
 		var b2 = src.b;
 		var b2 = src.b;