Skip to content

Commit

Permalink
store correct table offset when writing archive
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Aug 20, 2017
1 parent d1d1a66 commit c5b33d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/DRS.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,13 @@ DRS.prototype.archive = function () {
}

function getTableInfo () {
var tableOffset = (drs.isSWGB ? HEADER_SIZE_SWGB : HEADER_SIZE_AOE) +
TABLE_META_SIZE * drs.tables.length

return fromBuffer(Buffer.concat(
drs.tables.map(function (table) {
table.offset = tableOffset
tableOffset += table.numFiles * FILE_META_SIZE
return tableStruct.encode(table)
})
))
Expand Down

0 comments on commit c5b33d8

Please sign in to comment.