diff --git a/core/rfb.js b/core/rfb.js index 4cc9be6f..2cf6199e 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -493,8 +493,8 @@ export default class RFB extends EventTargetMixin { for (let i = 0; i < text.length; i++) { // FIXME: text can have values outside of Latin1/Uint8 let idx = text.charCodeAt(i); - data[i] = idx & 0xff; - data[i + 1] = idx >> 8; + data[i * 2] = idx & 0xff; + data[i * 2 + 1] = idx >> 8; } RFB.messages.clientCutText(this._sock, data);