From 6d1dadd0bf5bc36a4eb156dec682fcf62dccb178 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Mon, 13 Nov 2017 12:28:54 +0100 Subject: [PATCH] Fix #66 - invalid pax header when length+digits is 100 (#77) --- headers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers.js b/headers.js index 8aab8b5..31a8364 100644 --- a/headers.js +++ b/headers.js @@ -156,7 +156,7 @@ var decodeStr = function (val, offset, length) { var addLength = function (str) { var len = Buffer.byteLength(str) var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 - if (len + digits > Math.pow(10, digits)) digits++ + if (len + digits >= Math.pow(10, digits)) digits++ return (len + digits) + str }