From bf02d509090e3b2569baaf3422a646b5f2440120 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 25 May 2012 11:43:38 +0200 Subject: [PATCH] fix a bug in Ox.decodeDeflate (slice(1,-0) returns '') --- source/Ox/js/Encoding.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Encoding.js b/source/Ox/js/Encoding.js index 926b107e..a0ae93fc 100644 --- a/source/Ox/js/Encoding.js +++ b/source/Ox/js/Encoding.js @@ -223,7 +223,9 @@ Ox.decodeDeflate = function(string, callback) { try { // Parse the first byte as number of bytes to chop at the end, // and the rest, without these bytes, as an UTF8-encoded string. - string = Ox.decodeUTF8(string.slice(1, -string.charCodeAt(0))); + string = Ox.decodeUTF8( + string.slice(1, -string.charCodeAt(0) || void 0) + ); } catch (e) { error(); }