From 39f700a6c26bada413c194cb1242d7dd01e963e5 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 10:30:08 +0100 Subject: When reading file, truncate not full buffer --- src/lauxlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lauxlib.js b/src/lauxlib.js index c2852ac..1b306a3 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -437,7 +437,7 @@ if (typeof require === "function") { lf.pos += bytes; } if (bytes > 0) - return lf.binary ? toDataView(lf.buff) : new lobject.TValue(0, lf.buff).jsstring(); // TODO: Here reading utf8 only + return lf.binary ? toDataView(lf.buff) : new lobject.TValue(0, lf.buff).jsstring(0, bytes); // TODO: Here reading utf8 only else return null; }; -- cgit v1.2.3-70-g09d2