|
@@ -47,11 +47,11 @@ class FileInput extends haxe.io.Input {
|
|
|
public override function readBytes( s : Bytes, p : Int, l : Int ) : Int {
|
|
|
if(feof(__f)) throw new Eof();
|
|
|
var r = fread(__f, l);
|
|
|
- if(strlen(r) == 0) throw new Eof();
|
|
|
if(r == false) throw Custom('An error occurred');
|
|
|
+ if(strlen(r) == 0) throw new Eof();
|
|
|
var b = Bytes.ofString(r);
|
|
|
- s.blit(p, b, 0, (r:String).length);
|
|
|
- return (r:String).length;
|
|
|
+ s.blit(p, b, 0, strlen(r));
|
|
|
+ return strlen(r);
|
|
|
}
|
|
|
|
|
|
public override function close() : Void {
|