Skip to content

Commit

Permalink
Merge pull request #2 from draustus/add-error-checks
Browse files Browse the repository at this point in the history
Add error checks for WriteString calls
  • Loading branch information
unklnik authored May 20, 2024
2 parents 3d6daac + 8a18efb commit 7e4da00
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4822,9 +4822,12 @@ func savesettings() { //MARK:SAVE SETTINGS
settingsTXT = settingsTXT + "0"
}

f.WriteString(settingsTXT)

_, err = f.WriteString(settingsTXT)
if err != nil {
fmt.Printf("Failed to write settings: %s", err)
}
}

func addtime() { //MARK:ADD TIME

totaltime := minsEND*60 + secsEND
Expand Down Expand Up @@ -4923,9 +4926,12 @@ func savetimes() { //MARK: SAVE TIMES
}
}

f.WriteString(scoresTXT)

_, err = f.WriteString(scoresTXT)
if err != nil {
fmt.Printf("Failed to write times: %s", err)
}
}

func exitgame() { //MARK: EXIT GAME

if optionsChange {
Expand Down

0 comments on commit 7e4da00

Please sign in to comment.