Skip to content

Commit f42f9c7

Browse files
authored
Update encode.js
truncate volume name, possibly foolhardy. Inspired by this: LinusU#7
1 parent fb006c2 commit f42f9c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/encode.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ module.exports = exports = function (info) {
3535
assert(type === 0 || type === 1, 'Type is valid')
3636
buf.writeUInt16BE(type, 8)
3737

38-
var volNameLength = info.volume.name.length
39-
assert(volNameLength <= 27, 'Volume name is not longer than 27 chars')
38+
var volNameLength = info.volume.name.slice(0,27).length
4039
buf.writeUInt8(volNameLength, 10)
4140
buf.fill(0, 11, 11 + 27)
4241
buf.write(info.volume.name, 11, 'utf8')

0 commit comments

Comments
 (0)