From 5513563892dce6a703839a925172775db2f68e7b Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 6 Aug 2017 01:35:25 -0700 Subject: [PATCH] util: minor. --- lib/utils/util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/utils/util.js b/lib/utils/util.js index 97217940..c51c9e2b 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -865,7 +865,10 @@ util.fromFixed = function fromFixed(str, exp) { while (lo.length < exp) lo += '0'; - assert(/^\d*$/.test(hi) && /^\d*$/.test(lo), + if (lo.length === 0) + lo = '0'; + + assert(/^\d+$/.test(hi) && /^\d+$/.test(lo), 'Non-numeric characters in fixed number string.'); hi = parseInt(hi, 10);