From 5f87f3a1ac9837d0aaf8ffdb99966eed05556ac9 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 9 Mar 2017 04:04:06 +0000 Subject: [PATCH] Update unicode.lua to use string.(un)pack over bin.(un)pack --- nselib/unicode.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nselib/unicode.lua b/nselib/unicode.lua index 2ab4be3ad..d7ec93bec 100644 --- a/nselib/unicode.lua +++ b/nselib/unicode.lua @@ -20,8 +20,8 @@ local lshift = bit.lshift local rshift = bit.rshift local byte = string.byte local char = string.char -local pack = bin.pack -local unpack = bin.unpack +local pack = string.pack +local unpack = string.unpack ---Decode a buffer containing Unicode data. @@ -86,9 +86,9 @@ end -- false (little-endian) --@return A string containing the code point in UTF-16 encoding. function utf16_enc(cp, bigendian) - local fmt = "= 0xD800 and cp <= 0xDFFF then local high = lshift(cp - 0xD800, 10) - pos, cp = unpack(fmt, buf, pos) + cp, pos = unpack(fmt, buf, pos) cp = 0x10000 + high + cp - 0xDC00 end return pos, cp