Skip to content

Commit

Permalink
Fixed issue shakinm#18
Browse files Browse the repository at this point in the history
  • Loading branch information
kleeon committed Feb 21, 2023
1 parent d2e521d commit 55e9397
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cfb/cfb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package cfb
import (
"bytes"
"encoding/binary"
"github.com/shakinm/xlsReader/helpers"
"io"
"os"
"path/filepath"

"github.com/shakinm/xlsReader/helpers"
)

// Cfb - Compound File Binary
Expand Down Expand Up @@ -227,14 +228,16 @@ func (cfb *Cfb) getFatSectors() (err error) { // nolint: gocyclo
}
func (cfb *Cfb) getDataFromMiniFat(miniFatSectorLocation uint32, offset uint32) (data []byte, err error) {

sPoint := cfb.sectorOffset(miniFatSectorLocation)
point := sPoint + cfb.calculateMiniFatOffset(offset)
point := cfb.calculateMiniFatOffset(offset)

containerStreamBytes, _ := cfb.getDataFromFatChain(miniFatSectorLocation)
containerStream := bytes.NewReader(containerStreamBytes)

for {

sector := NewMiniFatSector(&cfb.header)

err = cfb.getData(point, &sector.Data)
_, err := containerStream.ReadAt(sector.Data, int64(point))

if err != nil {
return data, err
Expand All @@ -248,7 +251,7 @@ func (cfb *Cfb) getDataFromMiniFat(miniFatSectorLocation uint32, offset uint32)

offset = cfb.miniFatPositions[offset]

point = sPoint + cfb.calculateMiniFatOffset(offset)
point = cfb.calculateMiniFatOffset(offset)

}

Expand Down

0 comments on commit 55e9397

Please sign in to comment.