Skip to content

Commit

Permalink
Merge pull request #23 from realrainer/master
Browse files Browse the repository at this point in the history
active record must have a space in deletion flag
  • Loading branch information
LindsayBradford authored Mar 16, 2022
2 parents a8432b1 + a2aa6a4 commit a4c6348
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions godbf/dbftable.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ func (dt *DbfTable) AddNewRecord() (newRecordNumber int) {
}

newRecord := make([]byte, dt.lengthOfEachRecord)
// each record begins with a 1-byte "deletion" flag. If record is active the byte's value is a space (0x20)
if dt.lengthOfEachRecord > 0 {
newRecord[0] = 0x20
}
dt.dataStore = appendSlice(dt.dataStore, newRecord)

// since row numbers are "0" based first we set newRecordNumber
Expand Down

0 comments on commit a4c6348

Please sign in to comment.