From 17c6ff62a099fb90c8e27ca44d6665e7b31c26ca Mon Sep 17 00:00:00 2001
From: Daniel Cousens <github@dcousens.com>
Date: Wed, 31 Aug 2016 13:40:11 +1000
Subject: [PATCH] bufferutils: fix pushDataInt output

---
 src/bufferutils.js             | 4 ++--
 test/fixtures/bufferutils.json | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bufferutils.js b/src/bufferutils.js
index 8e6db04..d4f3153 100644
--- a/src/bufferutils.js
+++ b/src/bufferutils.js
@@ -10,8 +10,8 @@ function verifuint (value, max) {
 
 function pushDataSize (i) {
   return i < opcodes.OP_PUSHDATA1 ? 1
-  : i < 0xff ? 2
-  : i < 0xffff ? 3
+  : i <= 0xff ? 2
+  : i <= 0xffff ? 3
   : 5
 }
 
diff --git a/test/fixtures/bufferutils.json b/test/fixtures/bufferutils.json
index baa003f..db1e1da 100644
--- a/test/fixtures/bufferutils.json
+++ b/test/fixtures/bufferutils.json
@@ -34,7 +34,7 @@
       "dec": 255,
       "hex64": "ff00000000000000",
       "hexVI": "fdff00",
-      "hexPD": "4dff00"
+      "hexPD": "4cff"
     },
     {
       "dec": 65534,
@@ -46,7 +46,7 @@
       "dec": 65535,
       "hex64": "ffff000000000000",
       "hexVI": "fdffff",
-      "hexPD": "4effff0000"
+      "hexPD": "4dffff"
     },
     {
       "dec": 65536,