Commit 8867b8ca authored by Yoann Pigné's avatar Yoann Pigné

Extra '0' in strings BUG

parent afac8868
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// Copyright (c) 2008 notmasteryet // Copyright (c) 2008 notmasteryet
global.netstream.TypedArrayReader = function (t_array) { global.netstream.TypedArrayReader = function (t_array) {
"use strict";
this.position = 0; this.position = 0;
this.array = new Uint8Array(t_array.buffer, t_array.byteOffset, t_array.byteLength); this.array = new Uint8Array(t_array.buffer, t_array.byteOffset, t_array.byteLength);
this.readByte = function () { this.readByte = function () {
...@@ -93,19 +93,18 @@ global.netstream.Utf8Translator = function (reader) { ...@@ -93,19 +93,18 @@ global.netstream.Utf8Translator = function (reader) {
// BEING USED // BEING USED
// //
global.netstream.typedArrayToString = function (input) { global.netstream.typedArrayToString = function (input) {
"use strict";
var reader = new netstream.TypedArrayReader(input), var reader = new netstream.TypedArrayReader(input),
utf8 = new netstream.Utf8Translator(reader), utf8 = new netstream.Utf8Translator(reader),
result = [], result = [],
i = 0, i = 0,
ch = 0, ch = 0,
s = ""; s = "";
do { ch = utf8.readChar();
ch = utf8.readChar(); while (ch.charCodeAt(0) !== 0) {
result[i++] = ch; result[i++] = ch;
ch = utf8.readChar();
} }
while (ch.charCodeAt(0) !== 0);
s = result.join(""); s = result.join("");
return s; return s;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment