From 6cbc1afb9b5c1f8c3f33da5bc41f317b0934d719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20L=C3=A9caud=C3=A9?= Date: Tue, 2 Aug 2016 11:09:41 -0400 Subject: [PATCH] Fix split character in TCP Request node --- nodes/core/io/31-tcpin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes/core/io/31-tcpin.js b/nodes/core/io/31-tcpin.js index 5420af297..12c4e4f20 100644 --- a/nodes/core/io/31-tcpin.js +++ b/nodes/core/io/31-tcpin.js @@ -393,8 +393,11 @@ module.exports = function(RED) { this.splitc = n.splitc; if (this.out != "char") { this.splitc = Number(this.splitc); } - else { this.splitc = this.splitc.replace("\\n",0x0A).replace("\\r",0x0D).replace("\\t",0x09).replace("\\e",0x1B).replace("\\f",0x0C).replace("\\0",0x00); } // jshint ignore:line - + else { + this.splitc = this.splitc.replace("\\n",0x0A).replace("\\r",0x0D).replace("\\t",0x09).replace("\\e",0x1B).replace("\\f",0x0C).replace("\\0",0x00); + if (typeof this.splitc == "string") { this.splitc = this.splitc.charCodeAt(0); } + } // jshint ignore:line + var buf; if (this.out == "count") { if (this.splitc === 0) { buf = new Buffer(1); }