forked from LittleChest/dns-packet
fix bug in txt encoding length
This commit is contained in:
parent
d8d3514ea8
commit
32ca5ff640
1
index.js
1
index.js
@ -204,6 +204,7 @@ rtxt.decode = function (buf, offset) {
|
|||||||
rtxt.decode.bytes = 0
|
rtxt.decode.bytes = 0
|
||||||
|
|
||||||
rtxt.encodingLength = function (data) {
|
rtxt.encodingLength = function (data) {
|
||||||
|
if (!data) return 2
|
||||||
return (Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)) + 2
|
return (Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)) + 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user