diff --git a/binding/nodejs/ip2region.js b/binding/nodejs/ip2region.js index 70bd0c7..26fdaef 100644 --- a/binding/nodejs/ip2region.js +++ b/binding/nodejs/ip2region.js @@ -121,7 +121,7 @@ ip2region.btreeSearchSync = function(ip) mid = ((low + high) >> 1); if (ip == headerSip[mid]) { - if ( m > 0) { + if ( mid > 0) { sptr = headerPtr[mid - 1]; eptr = headerPtr[mid]; } else {