Skip to content

Commit

Permalink
Update tab_csv.go
Browse files Browse the repository at this point in the history
  • Loading branch information
hible committed Aug 8, 2022
1 parent fb16ad5 commit edcaadb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions v3/helper/tab_csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ func (self *CSVFile) Load(fileName string) error {
return err
}

if data[0] == 0xef || data[1] == 0xbb || data[2] == 0xbf {
data = data[3:]
if len(data) > 3 {
if data[0] == 0xef || data[1] == 0xbb || data[2] == 0xbf {
data = data[3:]
}
}

self.Name = strings.TrimSuffix(fileName, filepath.Ext(fileName))
Expand Down

0 comments on commit edcaadb

Please sign in to comment.